-
Notifications
You must be signed in to change notification settings - Fork 25
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 to configure the rootValue #30
Comments
This makes sense! Thank you for opening an issue, I will tackle this rather soon. |
# [1.10.0](v1.9.0...v1.10.0) (2022-12-24) ### Features * **handler:** Accept a GraphQL execution rootValue ([0f04fa2](0f04fa2)), closes [#30](#30)
🎉 This issue has been resolved in version 1.10.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@enisdenjo There isn't much documentation available on how to use rootValue. Like in the samples shared in the issue's description by this issue's author, we get access to query arguments and the request object as the 1st & 2nd parameters of each resolver defined via rootValue in express-graphql. But in graphql-http, that isn't the case, I think, since graphql-http when calling the resolvers passed undefined as the 2nd argument instead of |
Hey, I figured out how it works.. you need to use the |
Story
As a user migrating from
express-graphql
, I want to pass arootValue
resolver. Withexpress-graphql
, I was able to do the following:Ideally, I would like to set
rootValue
as an option ofcreateHandler
Acceptance criteria
rootValue
without overriding the wholeExecutionContext
withonSubscribe
rootValue
Note
Maybe using a
rootValue
is not recommended anymore? Maybe there's an alternative? For reference, here's how I declare my schema/resolvers:The text was updated successfully, but these errors were encountered: