Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make typeResolver optional in nodeDefinitions #9

Closed
mhart opened this issue Aug 16, 2015 · 3 comments
Closed

Make typeResolver optional in nodeDefinitions #9

mhart opened this issue Aug 16, 2015 · 3 comments
Assignees

Comments

@mhart
Copy link

mhart commented Aug 16, 2015

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

@mhart
Copy link
Author

mhart commented Aug 16, 2015

(FWIW, this is more of a Flow/type issue, not an in-practice issue)

@dschafer dschafer self-assigned this Aug 18, 2015
@dschafer
Copy link
Contributor

Yep, good call, we should do this.

@mhart
Copy link
Author

mhart commented Aug 18, 2015

Awesome, thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants