Skip to content

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

@sachindshinde

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");

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