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 55import graphql .PublicApi ;
66import graphql .language .Definition ;
77import graphql .language .Document ;
8+ import graphql .language .SDLDefinition ;
89import graphql .parser .Parser ;
910import graphql .schema .idl .errors .SchemaProblem ;
1011import org .antlr .v4 .runtime .misc .ParseCancellationException ;
@@ -101,7 +102,9 @@ public TypeDefinitionRegistry buildRegistry(Document document) {
101102 TypeDefinitionRegistry typeRegistry = new TypeDefinitionRegistry ();
102103 List <Definition > definitions = document .getDefinitions ();
103104 for (Definition definition : definitions ) {
104- typeRegistry .add (definition ).ifPresent (errors ::add );
105+ if (definition instanceof SDLDefinition ) {
106+ typeRegistry .add ((SDLDefinition ) definition ).ifPresent (errors ::add );
107+ }
105108 }
106109 if (errors .size () > 0 ) {
107110 throw new SchemaProblem (errors );
You can’t perform that action at this time.
0 commit comments