Skip to content

Commit

Permalink
Merge pull request #4421 from rmosolgo/load-schema-directives
Browse files Browse the repository at this point in the history
Properly load schema directives from SDL
  • Loading branch information
rmosolgo authored Apr 5, 2023
2 parents 62e3a7a + d611f55 commit ea45d0e
Show file tree
Hide file tree
Showing 6 changed files with 1,064 additions and 1,015 deletions.
1,079 changes: 546 additions & 533 deletions graphql-c_parser/ext/graphql_c_parser_ext/parser.c

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions graphql-c_parser/ext/graphql_c_parser_ext/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -479,18 +479,22 @@ type_system_definition:
| directive_definition

schema_definition:
SCHEMA directives_list_opt LCURLY operation_type_definition_list RCURLY {
SCHEMA directives_list_opt operation_type_definition_list_opt {
$$ = MAKE_AST_NODE(SchemaDefinition, 6,
rb_ary_entry($1, 1),
rb_ary_entry($1, 2),
// TODO use static strings:
rb_hash_aref($4, rb_str_new_cstr("query")),
rb_hash_aref($4, rb_str_new_cstr("mutation")),
rb_hash_aref($4, rb_str_new_cstr("subscription")),
rb_hash_aref($3, rb_str_new_cstr("query")),
rb_hash_aref($3, rb_str_new_cstr("mutation")),
rb_hash_aref($3, rb_str_new_cstr("subscription")),
$2
);
}

operation_type_definition_list_opt:
/* none */ { $$ = rb_hash_new(); }
| LCURLY operation_type_definition_list RCURLY { $$ = $2; }

operation_type_definition_list:
operation_type_definition {
$$ = rb_hash_new();
Expand Down
Loading

0 comments on commit ea45d0e

Please sign in to comment.