Skip to content

[supermassive] Wrong Location type is used on DocumentWithMinimalViableSchema #546

@alina-zaieva

Description

@alina-zaieva

DocumentWithMinimalViableSchema type in its definition reuses types from GraphQL.js for definitions property, but for some reason this is not the case for loc property:

  1. DocumentWithMinimalViableSchema#loc uses built-in Location type (i.e., the type of window.location).
  2. DocumentNode#loc uses their own Location type (https://github.com/graphql/graphql-js/blob/5adeb7f7721e299d6f747bf9c985387164b79fff/src/language/ast.ts#L9).

The two are not compatible and so it is not possible to pass DocumentWithMinimalViableSchema where DocumentNode is expected. This does not seem intentional to me since a document has nothing to do with in-browser location 🙂

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