Skip to content

Invalid location is used inside GraphQL error #3661

@IvanGoncharov

Description

@IvanGoncharov

Describe the bug
Per GraphQL spec, the error location should only be specified IF it can point to a valid location (i.e., starting with a positive column/row).
https://spec.graphql.org/draft/#sel-GAPHRPFCCaCGX5zM

This value was returned:

public static final SourceLocation EMPTY = new SourceLocation(-1, -1);

It is assigned here:
SourceLocation location = sourceLocation == null ? SourceLocation.EMPTY : sourceLocation;

To Reproduce
I don't have a Java environment on my machine, so I can't test it myself :(

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