File tree Expand file tree Collapse file tree
src/main/java/graphql/schema/idl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,9 +158,11 @@ private GraphQLSchema makeExecutableSchemaImpl(BuildContext buildCtx) {
158158 @ SuppressWarnings ("OptionalGetWithoutIsPresent" )
159159 OperationTypeDefinition queryOp = operationTypes .stream ().filter (op -> "query" .equals (op .getName ())).findFirst ().get ();
160160 Optional <OperationTypeDefinition > mutationOp = operationTypes .stream ().filter (op -> "mutation" .equals (op .getName ())).findFirst ();
161+ Optional <OperationTypeDefinition > subscriptionOp = operationTypes .stream ().filter (op -> "subscription" .equals (op .getName ())).findFirst ();
161162
162163 GraphQLObjectType query = buildOperation (buildCtx , queryOp );
163164 GraphQLObjectType mutation ;
165+ GraphQLObjectType subscription ;
164166
165167 GraphQLSchema .Builder schemaBuilder = GraphQLSchema
166168 .newSchema ()
@@ -170,6 +172,10 @@ private GraphQLSchema makeExecutableSchemaImpl(BuildContext buildCtx) {
170172 mutation = buildOperation (buildCtx , mutationOp .get ());
171173 schemaBuilder .mutation (mutation );
172174 }
175+ if (subscriptionOp .isPresent ()) {
176+ subscription = buildOperation (buildCtx , subscriptionOp .get ());
177+ schemaBuilder .subscription (subscription );
178+ }
173179 return schemaBuilder .build ();
174180 }
175181
You can’t perform that action at this time.
0 commit comments