Closed
Description
What
- Currently, we cannot set up the
express
server so that we can access theresponse
from inside of resolvers.
Why
- It's important to support this so that users can do things like -- in my current use case -- access the
cookie
on the response inside of resolvers, which could be important for a lot of basic authentication setups, for example with Jason Web Tokens as I am doing.
How
- We should add support so that we can pass the response as a second parameter in
schema.addToContext
along with therequest
, with an implementation that would look something like:
schema.addToContext((request, response) => ({
request,
response,
}))