Skip to content

Input Coercion for Non-Null states that field(arg: null) is illegal, but it's not #52

@swolchok

Description

@swolchok

From http://facebook.github.io/graphql/#sec-Non-Null :

NOTE that null is not a valid keyword in GraphQL, so a query cannot look like:
{
field(arg: null)
}
to indicate that the argument is null.

However, this example should actually parse, according to the given grammar. It is a valid Arguments with one Argument whose Value is an EnumValue with the Name "null". This is a consequence of the keywordless approach to grammar definition. I'm not sure how to succinctly explain that this example may be legal, but not because null is a pre-defined keyword that necessarily means the same thing as "unset variable", and that there isn't a way to get it to typecheck for all calls generally given the rest of the system.

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