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
apolloOptions.context type and default value #75
Comments
Yeah, it's true that there's a bit of a mismatch. The reason we let it be |
@helfer it will be very helpfull, i've moving to new server and spent some time to make it works, before i found the solution! just because graphql-implementation make it required. |
If someone could submit a PR to the docs, that would be great! 😃 |
Guys, since context now it an object, how can I modify context based on request? In Meteor the context is filled with userID, so how can this be achieved with the new design ? I need context to be a function that accepts request. |
I think this issue is mostly solved, so I'll close this. Feel free to open again if there's still something to discuss. |
By default context is undefined and has a type to
any
.attachConnectorsToContext
fromgraphql-tools
works only with anobject
typed context.If context is undefined, it will raise an error for each requests.
So, we have to explicitely set context to an empty object to make it working :
Maybe apolloOptions.context can have a default value setted to
{}
and be explicitely typed asObject
.The text was updated successfully, but these errors were encountered: