Skip to content

Make typeResolver optional in nodeDefinitions #9

@mhart

Description

@mhart

AFAICT graphql-js allows you to leave out resolveType here:

https://github.com/graphql/graphql-js/blob/a149b89a3047f38750eaade1f220eb1317eb9217/src/type/definition.js#L684-L685

In which case it will fall back to using getTypeOf/isTypeOf

The problem is, nodeDefinitions doesn't seem to allow you to leave out the typeResolver function:

resolveType: typeResolver

Making this optional would certainly reduce a lot of boilerplate code

Metadata

Metadata

Assignees

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