Skip to content

Commit 8bc56f7

Browse files
authored
Merge pull request #115 from wravery/default-list-values
Fix #114
2 parents a1968cb + 0f36d7f commit 8bc56f7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

include/graphqlservice/GraphQLGrammar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ struct input_value
382382
};
383383

384384
struct list_entry
385-
: input_value
385+
: input_value_content
386386
{
387387
};
388388

test/PegtlTests.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,19 @@ TEST(PegtlCase, ParseTodaySchema)
391391
ASSERT_TRUE(result) << "we should be able to parse the doc";
392392
}
393393

394+
TEST(PegtlCase, ParseVariableDefaultEmptyList)
395+
{
396+
memory_input<> input(R"gql(
397+
query QueryWithEmptyListVariable($empty: [Boolean!]! = []) {
398+
fieldWithArg(arg: $empty)
399+
})gql",
400+
"ParseVariableDefaultEmptyList");
401+
402+
const bool result = parse<document>(input);
403+
404+
ASSERT_TRUE(result) << "we should be able to parse the doc";
405+
}
406+
394407
TEST(PegtlCase, AnalyzeGrammar)
395408
{
396409
ASSERT_EQ(0, analyze<document>(true)) << "there shuldn't be any infinite loops in the PEG version of the grammar";

0 commit comments

Comments
 (0)