Skip to content

Commit 3a96047

Browse files
committed
quick bugfix: add 'subscriptionType' field to support newer introspection queries
1 parent 34e3345 commit 3a96047

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/main/java/graphql/introspection/Introspection.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public Object get(DataFetchingEnvironment environment) {
352352
.name("__Schema")
353353
.description("A GraphQL Introspection defines the capabilities" +
354354
" of a GraphQL server. It exposes all available types and directives on " +
355-
"'the server, as well as the entry points for query and 'mutation operations.")
355+
"the server, the entry points for query, mutation, and subscription operations.")
356356
.field(newFieldDefinition()
357357
.name("types")
358358
.description("A list of all types supported by this server.")
@@ -400,6 +400,18 @@ public Object get(DataFetchingEnvironment environment) {
400400
}
401401
})
402402
.build())
403+
.field(newFieldDefinition()
404+
.name("subscriptionType")
405+
.description("'If this server support subscription, the type that subscription operations will be rooted at.")
406+
.type(__Type)
407+
.dataFetcher(new DataFetcher() {
408+
@Override
409+
public Object get(DataFetchingEnvironment environment) {
410+
// Not yet supported
411+
return null;
412+
}
413+
})
414+
.build())
403415
.build();
404416

405417

0 commit comments

Comments
 (0)