Skip to content

Clear-up disambiguity when using TypeExtension's and query shorthand #539

Closed
@budde377

Description

@budde377

When implementing a parser from the spec. I had a hard time deciding on the right case when certain TypeExtensions are used with the query operation shorthand. Namely the EnumTypeExtension, InputObjectTypeExtension, InterfaceTypeExtension, and ObjectTypeExtension.

The issue arises with programs like the following:

extend interface Foo @somedir
{
  bar: String
}

this can according to the specification be interpreted as either

  1. the document containing a single InterfaceTypeExtension with the bar: String field definition (and a directive),
  2. or the document containing a InterfaceTypeExtension and a shorthand query with the field String aliased as bar.

Notice that the program

extend interface Foo
{
  bar: String
}

is unequivocally a document containing a single InterfaceTypeExtension.

I would like to get this ambiguity cleared up and would be happy to submit a PR with the right solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions