Skip to content

Inconsisten null requirement for locations #2637

@yak01

Description

@yak01

Description
The InputMapDefinesTooManyFieldsException returns null as locations, but the GraphqlErrorBuilder throws an exception for null as locations.

This seems inconsistent. Though it may not lead to direct conflicts in this project, it is confusing for using projects. For instance, the default error handling of graphql-spring-boot in consequence does not properly handle the InputMapDefinesTooManyFieldsException, see GraphQLErrorFromExceptionHandler#withThrowable.

Possible Solutions
I see three obvious directions:

  1. Commit to non-null locations on GraphQLError.
  2. Handle null as locations in the GraphqlErrorBuilder.
  3. Keep the inconsistency and document it better, so that using frameworks or projects do not rely on false assumptions.

Open Question
Either solution would be fine for me and I may propose a pull request for it. The order above is just my personal preference. Which way to proceed?

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