I'm currently trying to get the request body in context because the body part contains a JWT that needs to be decoded. However, when I try to do the following, I get undefined for the context:
app.use('/', graphqlHTTP((req) => ({ schema: Schema, context: req.body, pretty: true, graphiql: false })));
I logged out and I did not see the body there. I use a library called react-reach , it adds the following to the request body:
{ query: {...}, queryParams: {...}, options: { token: '...'
I know that the body is interpreted because my requests / mutations that are in the body are interpreted and executed. It simply cannot find it when it is passed into context.
source share