Skip to content

ANTLR grammar doesn't match GraphQL spec for directive locations #2649

Closed

Description

@sachindshinde

Describe the bug

Looking at the 2018 GraphQL spec, it has for a while allowed for an optional leading | in directive locations. E.g., the following is valid GraphQL:

directive @foo on
    | OBJECT
    | INTERFACE

However, trying to parse this with graphql-java throws, because the ANTLR grammar doesn't allow the optional leading |.

To Reproduce

This code snippet throws:

new SchemaParser().parse("directive @foo on | OBJECT");

Activity

  1. added a commit that references this issue on Dec 19, 2021
    4362043
  2. jord1e commented on Dec 19, 2021

    @jord1e
    Contributor

    graphql-js does not seem to have test cases describing this. It does have them for unions, weird

  3. added a commit that references this issue on Dec 20, 2021
    4a82b0b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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