Skip to content

Commit ba15579

Browse files
Added conditional compliation logic.
1 parent d3b1433 commit ba15579

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/integrations/serde.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ use serde::ser::SerializeMap;
33
use std::fmt;
44
use std::collections::HashMap;
55

6-
use ::{GraphQLError, Value, Variables};
6+
use ::{GraphQLError, Value};
7+
#[cfg(feature="iron-handlers")]
8+
use ::Variables;
79
use ast::InputValue;
810
use executor::ExecutionError;
911
use parser::{ParseError, Spanning, SourcePosition};
@@ -225,6 +227,7 @@ pub struct GraphQlQuery {
225227
variables: Option<InputValue>
226228
}
227229

230+
#[cfg(feature="iron-handlers")]
228231
impl GraphQlQuery {
229232

230233
pub fn new(query: String,
@@ -260,6 +263,7 @@ impl GraphQlQuery {
260263
#[cfg(feature="iron-handlers")]
261264
pub struct WrappedGraphQLResult<'a>(Result<(Value, Vec<ExecutionError>), GraphQLError<'a>>);
262265

266+
#[cfg(feature="iron-handlers")]
263267
impl<'a> WrappedGraphQLResult<'a> {
264268
pub fn new(result: Result<(Value, Vec<ExecutionError>),
265269
GraphQLError<'a>>
@@ -268,6 +272,7 @@ impl<'a> WrappedGraphQLResult<'a> {
268272
}
269273
}
270274

275+
#[cfg(feature="iron-handlers")]
271276
impl<'a> ser::Serialize for WrappedGraphQLResult<'a> {
272277
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
273278
where S: ser::Serializer,

0 commit comments

Comments
 (0)