parent
f247dbee48
commit
27e00419b0
7 changed files with 26 additions and 10 deletions
|
@ -10,6 +10,7 @@ pub struct Query;
|
|||
#[juniper::graphql_object]
|
||||
impl Query {
|
||||
fn r#type(r#fn: MyInputType) -> Vec<String> {
|
||||
let _ = r#fn;
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -343,12 +343,12 @@ where
|
|||
}
|
||||
|
||||
/// View the underlying int value, if present.
|
||||
pub fn as_int_value<'a>(&'a self) -> Option<i32> {
|
||||
pub fn as_int_value(&self) -> Option<i32> {
|
||||
self.as_scalar_value().and_then(|s| s.as_int())
|
||||
}
|
||||
|
||||
/// View the underlying float value, if present.
|
||||
pub fn as_float_value<'a>(&'a self) -> Option<f64> {
|
||||
pub fn as_float_value(&self) -> Option<f64> {
|
||||
self.as_scalar_value().and_then(|s| s.as_float())
|
||||
}
|
||||
|
||||
|
|
|
@ -1085,7 +1085,7 @@ mod named_operations {
|
|||
#[crate::graphql_object_internal]
|
||||
impl Schema {
|
||||
fn a(p: Option<String>) -> &str {
|
||||
dbg!(p);
|
||||
let _ = p;
|
||||
"b"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#![deny(unused_variables)]
|
||||
|
||||
use juniper_codegen::GraphQLInputObjectInternal as GraphQLInputObject;
|
||||
|
||||
use crate::{
|
||||
|
@ -10,13 +12,13 @@ use crate::{
|
|||
|
||||
struct Root;
|
||||
|
||||
#[derive(GraphQLInputObject)]
|
||||
#[derive(GraphQLInputObject, Debug)]
|
||||
struct DefaultName {
|
||||
field_one: String,
|
||||
field_two: String,
|
||||
}
|
||||
|
||||
#[derive(GraphQLInputObject)]
|
||||
#[derive(GraphQLInputObject, Debug)]
|
||||
struct NoTrailingComma {
|
||||
field_one: String,
|
||||
field_two: String,
|
||||
|
@ -96,6 +98,17 @@ impl Root {
|
|||
a10: NamedPublic,
|
||||
a11: FieldWithDefaults,
|
||||
) -> i32 {
|
||||
let _ = a1;
|
||||
let _ = a2;
|
||||
let _ = a3;
|
||||
let _ = a4;
|
||||
let _ = a5;
|
||||
let _ = a6;
|
||||
let _ = a7;
|
||||
let _ = a8;
|
||||
let _ = a9;
|
||||
let _ = a10;
|
||||
let _ = a11;
|
||||
0
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,8 +134,8 @@ impl Root {
|
|||
),
|
||||
)]
|
||||
fn args_with_complex_default(arg1: String, arg2: Point) -> i32 {
|
||||
dbg!(arg1);
|
||||
dbg!(arg2);
|
||||
let _ = arg1;
|
||||
let _ = arg2;
|
||||
0
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::borrow::Cow;
|
|||
///
|
||||
/// Note: needs to be public because several macros use it.
|
||||
#[doc(hidden)]
|
||||
pub fn to_camel_case<'a>(s: &'a str) -> Cow<'_, str> {
|
||||
pub fn to_camel_case(s: &'_ str) -> Cow<'_, str> {
|
||||
let mut dest = Cow::Borrowed(s);
|
||||
|
||||
for (i, part) in s.split('_').enumerate() {
|
||||
|
|
|
@ -206,11 +206,13 @@ pub fn impl_input_object(ast: &syn::DeriveInput, is_internal: bool) -> TokenStre
|
|||
e.to_tokens(&mut tokens);
|
||||
Some(tokens)
|
||||
}
|
||||
Err(_) => {
|
||||
Err(e) => {
|
||||
let _ = e;
|
||||
panic!("#graphql(default = ?) must be a valid Rust expression inside a string");
|
||||
}
|
||||
},
|
||||
Err(_) => {
|
||||
Err(e) => {
|
||||
let _ = e;
|
||||
panic!("#graphql(default = ?) must be a valid Rust expression inside a string");
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue