gqlparser icon indicating copy to clipboard operation
gqlparser copied to clipboard

gqlparser fails to parse `extend type` with a doc comment

Open boxmein opened this issue 4 years ago • 0 comments

If I have a type like this:

extend type Foo @key(fields: "id") {
  id: ID!
}

Then adding a doc comment will fail to parse.

Sample input:

"""
Doc comment
"""
extend type Foo @key(fields: "id") {
  id: ID!
}

Expected behavior: parses

Actual behavior:

failed to load schema:schema.graphqls:3: Unexpected BlockString "Doc comment"exit status 1

A possible workaround is available: the following code block parses correctly.

"""
Doc comment
"""
type Foo @key(fields: "id") @extends {
  id: ID!
}

boxmein avatar Jan 18 '21 10:01 boxmein