File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,12 @@ struct ast_selector<schema_extension>
525
525
{
526
526
};
527
527
528
+ template <>
529
+ struct ast_selector <operation_type_definition>
530
+ : std::true_type
531
+ {
532
+ };
533
+
528
534
template <>
529
535
struct ast_selector <scalar_type_extension>
530
536
: std::true_type
Original file line number Diff line number Diff line change @@ -316,11 +316,14 @@ bool Generator::fixupInputFieldList(InputFieldList& fields)
316
316
317
317
void Generator::visitDefinition (const peg::ast_node& definition)
318
318
{
319
- if (definition.is <peg::schema_definition>()
320
- || definition.is <peg::schema_extension>())
319
+ if (definition.is <peg::schema_definition>())
321
320
{
322
321
visitSchemaDefinition (definition);
323
322
}
323
+ else if (definition.is <peg::schema_extension>())
324
+ {
325
+ visitSchemaExtension (definition);
326
+ }
324
327
else if (definition.is <peg::scalar_type_definition>())
325
328
{
326
329
visitScalarTypeDefinition (definition);
@@ -383,6 +386,18 @@ void Generator::visitSchemaDefinition(const peg::ast_node& schemaDefinition)
383
386
});
384
387
}
385
388
389
+ void Generator::visitSchemaExtension (const peg::ast_node& schemaExtension)
390
+ {
391
+ peg::for_each_child<peg::operation_type_definition>(schemaExtension,
392
+ [this ](const peg::ast_node & child)
393
+ {
394
+ std::string operation (child.children .front ()->content ());
395
+ std::string name (child.children .back ()->content ());
396
+
397
+ _operationTypes.push_back ({ std::move (name), std::move (operation) });
398
+ });
399
+ }
400
+
386
401
void Generator::visitObjectTypeDefinition (const peg::ast_node& objectTypeDefinition)
387
402
{
388
403
std::string name;
Original file line number Diff line number Diff line change @@ -209,6 +209,7 @@ class Generator
209
209
void visitDefinition (const peg::ast_node& definition);
210
210
211
211
void visitSchemaDefinition (const peg::ast_node& schemaDefinition);
212
+ void visitSchemaExtension (const peg::ast_node& schemaExtension);
212
213
void visitScalarTypeDefinition (const peg::ast_node& scalarTypeDefinition);
213
214
void visitEnumTypeDefinition (const peg::ast_node& enumTypeDefinition);
214
215
void visitEnumTypeExtension (const peg::ast_node& enumTypeExtension);
You can’t perform that action at this time.
0 commit comments