-
Notifications
You must be signed in to change notification settings - Fork 565
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
Update docs for context option #10
Comments
Updated in the latest release. |
Would you please provide a link to the section in question? I could use some clarification. |
I agree, @karloluis. The context docs should be revisited and have their own subsection in the readme docs. @nikolasburk will look into this. |
Trying to use |
Its documented right here, const context = async ({ request }) => {
const ctx = {
timestamp: moment(),
}
const qs = querystring.parse(request.url);
if (process.env.NODE_ENV === 'development' && request.headers['x-timestamp']) {
ctx.timestamp = moment(request.headers['x-timestamp']);
}
return ctx;
};
const server = new GraphQLServer({
typeDefs,
resolvers,,
context,
}); |
Due to inactivity of this issue we have marked it |
Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of |
Due to inactivity of this issue we have marked it |
Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of |
Due to inactivity of this issue we have marked it |
Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of |
Hey, @Urigo from The Guild here! You might know us from projects such as graphql-code-generator, envelop or graphql-tools. For a long time we thought that the Javascript ecosystem is still missing a lightweight cross-platform, but still highly customizable GraphQL Server. In the past the awesome Prisma team took on that great challenge and now we are happy to announce that we are continuing them and just released GraphQL Yoga 2.0 - Build fast, extensible, and batteries-included (Subscriptions, Serverless, File uploads support) GraphQL APIs in Node.js 🚀 We have been working a long time on version 2.0 and have been using it in our clients projects for a few months now and shared a couple of alpha cycles here. Please try Yoga out again, give us feedback and help us spread the word on the new release! |
The readme shows that context is an object type but it also accepts a function. I found that out by reading the source code as I needed to intialize a new context object on every request. Its better if it would be a function always as the context is generally per graphql request.
The text was updated successfully, but these errors were encountered: