-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allow an optional function to resolve the rootValue #1555
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tgriesser Thanks for adding this support! Let's get some documentation for it in the API reference and then we can merge it
Great! Rebased & added API reference docs - let me know if you want me to add anything else. |
Not sure why the netlify check didn't pass |
Passes the parsed DocumentNode AST to determine the root value, useful when providing a different rootValue for query vs mutation
88facd6
to
47698b0
Compare
@evans bump |
@tgriesser Thank you! |
* Allow an optional function to resolve the rootValue Passes the parsed DocumentNode AST to determine the root value, useful when providing a different rootValue for query vs mutation * Add API docs for rootValue
It would be nice if we could pass the |
This allows providing a function to the
rootValue
option, which is called with the parsed query ASTDocumentNode
and the return value determines the value of the root.This is useful in situations where you want to provide a different
rootValue
depending on the operation type, for instance if therootValue
should be different for aquery
vs amutation
It also includes the commit from the type fixes in #1554
TODO: