Added conditional compliation logic.
This commit is contained in:
parent
d3b1433748
commit
ba15579531
1 changed files with 6 additions and 1 deletions
|
@ -3,7 +3,9 @@ use serde::ser::SerializeMap;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use ::{GraphQLError, Value, Variables};
|
use ::{GraphQLError, Value};
|
||||||
|
#[cfg(feature="iron-handlers")]
|
||||||
|
use ::Variables;
|
||||||
use ast::InputValue;
|
use ast::InputValue;
|
||||||
use executor::ExecutionError;
|
use executor::ExecutionError;
|
||||||
use parser::{ParseError, Spanning, SourcePosition};
|
use parser::{ParseError, Spanning, SourcePosition};
|
||||||
|
@ -225,6 +227,7 @@ pub struct GraphQlQuery {
|
||||||
variables: Option<InputValue>
|
variables: Option<InputValue>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature="iron-handlers")]
|
||||||
impl GraphQlQuery {
|
impl GraphQlQuery {
|
||||||
|
|
||||||
pub fn new(query: String,
|
pub fn new(query: String,
|
||||||
|
@ -260,6 +263,7 @@ impl GraphQlQuery {
|
||||||
#[cfg(feature="iron-handlers")]
|
#[cfg(feature="iron-handlers")]
|
||||||
pub struct WrappedGraphQLResult<'a>(Result<(Value, Vec<ExecutionError>), GraphQLError<'a>>);
|
pub struct WrappedGraphQLResult<'a>(Result<(Value, Vec<ExecutionError>), GraphQLError<'a>>);
|
||||||
|
|
||||||
|
#[cfg(feature="iron-handlers")]
|
||||||
impl<'a> WrappedGraphQLResult<'a> {
|
impl<'a> WrappedGraphQLResult<'a> {
|
||||||
pub fn new(result: Result<(Value, Vec<ExecutionError>),
|
pub fn new(result: Result<(Value, Vec<ExecutionError>),
|
||||||
GraphQLError<'a>>
|
GraphQLError<'a>>
|
||||||
|
@ -268,6 +272,7 @@ impl<'a> WrappedGraphQLResult<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature="iron-handlers")]
|
||||||
impl<'a> ser::Serialize for WrappedGraphQLResult<'a> {
|
impl<'a> ser::Serialize for WrappedGraphQLResult<'a> {
|
||||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
where S: ser::Serializer,
|
where S: ser::Serializer,
|
||||||
|
|
Loading…
Add table
Reference in a new issue