From 9b1a1dcce28705c24eda98fc873f1c8134bbcc67 Mon Sep 17 00:00:00 2001 From: artem Date: Wed, 11 Jan 2023 14:07:58 +0300 Subject: [PATCH] fix applied --- src/main/antlr/GraphqlSDL.g4 | 2 +- src/main/java/graphql/parser/GraphqlAntlrToLanguage.java | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/antlr/GraphqlSDL.g4 b/src/main/antlr/GraphqlSDL.g4 index 89666105f7..9c4ef2a4f1 100644 --- a/src/main/antlr/GraphqlSDL.g4 +++ b/src/main/antlr/GraphqlSDL.g4 @@ -16,7 +16,7 @@ schemaDefinition : description? SCHEMA directives? '{' operationTypeDefinition+ schemaExtension : EXTEND SCHEMA directives? '{' operationTypeDefinition+ '}' | - EXTEND SCHEMA directives+ + EXTEND SCHEMA directives ; operationTypeDefinition : description? operationType ':' typeName; diff --git a/src/main/java/graphql/parser/GraphqlAntlrToLanguage.java b/src/main/java/graphql/parser/GraphqlAntlrToLanguage.java index eb5070bc66..d35cf02909 100644 --- a/src/main/java/graphql/parser/GraphqlAntlrToLanguage.java +++ b/src/main/java/graphql/parser/GraphqlAntlrToLanguage.java @@ -407,10 +407,9 @@ private SDLDefinition creationSchemaExtension(GraphqlParser.SchemaExtensionConte addCommonData(def, ctx); List directives = new ArrayList<>(); - List directivesCtx = ctx.directives(); - for (GraphqlParser.DirectivesContext directiveCtx : directivesCtx) { - directives.addAll(createDirectives(directiveCtx)); - } + GraphqlParser.DirectivesContext directivesCtx = ctx.directives(); + directives.addAll(createDirectives(directivesCtx)); + def.directives(directives); List operationTypeDefs = map(ctx.operationTypeDefinition(), this::createOperationTypeDefinition);