Fix scalar and some tests under async

there is still some weirdness going on. Running async and
non-async tests in `integration_tests/*` works, but running it
from `integration_tests` does not.
This commit is contained in:
Christian Legnitto 2020-01-27 22:52:07 -05:00 committed by Christian Legnitto
parent c42c71b02d
commit c984457e91
10 changed files with 25 additions and 2 deletions

View file

@ -4,6 +4,9 @@ use fnv::FnvHashMap;
#[cfg(test)]
use juniper::{self, DefaultScalarValue, FromInputValue, GraphQLType, InputValue, ToInputValue};
#[cfg(feature = "async")]
use futures;
#[derive(juniper::GraphQLEnum, Debug, PartialEq)]
#[graphql(name = "Some", description = "enum descr")]
enum SomeEnum {

View file

@ -7,6 +7,9 @@ use juniper::{DefaultScalarValue, GraphQLObject};
#[cfg(test)]
use juniper::{self, execute, EmptyMutation, GraphQLType, RootNode, Value, Variables};
#[cfg(feature = "async")]
use futures;
#[derive(GraphQLObject, Debug, PartialEq)]
#[graphql(
name = "MyObj",

View file

@ -9,6 +9,9 @@ use juniper::{
GraphQLType, RootNode, Value, Variables,
};
#[cfg(feature = "async")]
use futures;
pub struct Query;
#[juniper::graphql_object]

View file

@ -1,3 +1,6 @@
#[cfg(feature = "async")]
use futures;
// Trait.
#[derive(juniper::GraphQLObject)]

View file

@ -1,4 +1,6 @@
use fnv::FnvHashMap;
#[cfg(feature = "async")]
use futures;
use juniper::{DefaultScalarValue, FromInputValue, GraphQLType, InputValue, ToInputValue};
#[derive(juniper::GraphQLScalarValue, PartialEq, Eq, Debug)]

View file

@ -1,5 +1,8 @@
extern crate serde_json;
#[cfg(feature = "async")]
use futures;
#[cfg(test)]
use juniper::parser::Spanning;
#[cfg(test)]

View file

@ -1,6 +1,9 @@
// Original author of this test is <https://github.com/davidpdrsn>.
use juniper::*;
#[cfg(feature = "async")]
use futures;
pub struct Context;
impl juniper::Context for Context {}

View file

@ -1,6 +1,9 @@
// Original author of this test is <https://github.com/davidpdrsn>.
use juniper::*;
#[cfg(feature = "async")]
use futures;
struct Query;
#[juniper::graphql_object]

View file

@ -409,8 +409,6 @@ macro_rules! graphql_scalar {
}
);
#[cfg(feature = "async")]
$crate::__juniper_impl_trait!(
impl <$($scalar)+> GraphQLTypeAsync for $name
where (

View file

@ -1,3 +1,5 @@
#[cfg(feature = "async")]
use futures;
use serde_derive::{Deserialize, Serialize};
use std::{char, convert::From, marker::PhantomData, ops::Deref, u32};