Just updated to 'graphql-server-express' version 1.3.0 and now I am getting this error when running any mutations:
POST body missing. Did you forget use body-parser middleware?
When initializing the server, I am including the "body-parser" package so I am not sure what is going on here. Any ideas?
Server Config:
//GraphQL Server
graphQLServer.use(
//GRAPHQL Endpoint
`/${settings.public.graphql.endpoint}`,
//Parse JSON
bodyParser.json(),
//authenticate
authenticateRequest,
//GRAPHQL Server
graphqlExpress(req => {
return {
schema: schema,
context: req
}
})
);
Example Request:
curl 'http://localhost:5050/graphql' \
-H 'authorization: Bearer xxxxxxxxxxx.xxxxxxxxxxx' \
-d '{
"query": "mutation { sensorData(sensorValue: \u0027asdasdasdasd \u0027)}",
"variables": {}
}
}'