Simple test - uncomment out either comment line to watch it fail with a syntax error.
func testParseDescription() throws {
let sourceText = """
# "Foo description text"
type Foo {
# "foo field description text"
fooType: Int
}
"""
let doc = try parse(instrumentation: NoOpInstrumentation, source: Source(body: sourceText))
for def in doc.definitions {
print( def.kind )
}
}
For this first one (object StypeSystemDefinition" the error appears to be on line 158 where it expects (requires) to find the name instead of checking for the optional description string.
Presumably the others are similar.
The list of nodes that can have a description according to the GraphQL Spec (working draft) seems to be:
via parseTypeSystemDefinition:
SchemaDefinition
ScalarTypeDefintion
ObjectTypeDefinition
InterfaceTypeDefinition
UnionTypeDefinition
EnumTypeDefinition
InputObjectTypeDefinition
DirectiveDefinition
others:
EnumValueDefinition
FieldDefinition
InputValueDefinition
I have a PR adding support for this that I'll post shortly.
Simple test - uncomment out either comment line to watch it fail with a syntax error.
For this first one (object StypeSystemDefinition" the error appears to be on line 158 where it expects (requires) to find the name instead of checking for the optional description string.
Presumably the others are similar.
The list of nodes that can have a description according to the GraphQL Spec (working draft) seems to be:
via parseTypeSystemDefinition:
others:
I have a PR adding support for this that I'll post shortly.