-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add to the context values the response of the route, because it is usefull for set cookies for example. #66
Comments
@enisdenjo Hi, hope you are doing great, do you know if is in the plans work on this item?, or if not what is the guide for contribute, because this is a must on my apps to migrate from graphql-express. I think I will be return to graphql-express until this is already done, if you need help to contribute this feature, it should be a pleasure to help. |
hey hey, sorry for the delay. I already have something in the pipe for this! will be pushed tomorrow |
@enisdenjo thank you!, if you need help, it sholud be a pleasure to help 👍🏼 |
@enisdenjo thank you for your improval, but the fix is missing on express version. |
Oh right, thanks for the heads up! I'll add it there too and then release a new version. |
🎉 This issue has been resolved in version 1.17.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This is now live with v1.17.0, example usage with import express from 'express'; // yarn add express
import { createHandler } from 'graphql-http/lib/use/express';
import { schema } from './my-graphql-schema';
const app = express();
app.all(
'/graphql',
createHandler({
schema,
context(req) {
req.context.res.setHeader('x-my-header', 'my-value');
return undefined;
},
}),
);
app.listen({ port: 4000 });
console.log('Listening to port 4000'); |
Thank you @enisdenjo, I tried and worked 👍🏼 |
Story
As a user or client or server
I want some feature
I want to add to the context values the response of the route, because it is usefull for set cookies for example.
So that some value
I want to add to the context values the response of the route, because it is usefull for set cookies for example.
Acceptance criteria
Something like this:
The text was updated successfully, but these errors were encountered: