graphitation
graphitation copied to clipboard
[supermassive] Wrong Location type is used on DocumentWithMinimalViableSchema
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:
-
DocumentWithMinimalViableSchema#locuses built-inLocationtype (i.e., the type ofwindow.location). -
DocumentNode#locuses their ownLocationtype (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 🙂
@alina-zaieva Good catch! We will happily accept a PR fixing this oversight.