Skip to content

Commit 4ca484c

Browse files
committed
Populate schema operations from introspected json
This is a bug uncovered while writing the wasm example
1 parent 3ec85fb commit 4ca484c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

graphql_query_derive/src/schema.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@ impl ::std::convert::From<::introspection_response::IntrospectionResponse> for S
280280
use introspection_response::__TypeKind;
281281

282282
let mut schema = Schema::new();
283-
let root = src.schema.expect("__Schema is not null");
283+
let root = src.schema.expect("__schema is not null");
284+
285+
schema.query_type = root.query_type.and_then(|ty| ty.name);
286+
schema.mutation_type = root.mutation_type.and_then(|ty| ty.name);
287+
schema.subscription_type = root.subscription_type.and_then(|ty| ty.name);
284288

285289
// Holds which objects implement which interfaces so we can populate GqlInterface#implemented_by later.
286290
// It maps interface names to a vec of implementation names.

0 commit comments

Comments
 (0)