how to migrate express graphql to graphql-http with request #85
Unanswered
blee-deloitte
asked this question in
Q&A
Replies: 1 comment
-
The - app.use('/graphql', createHandler(req => {context: req.headers})
+ app.use('/graphql', createHandler({context: req => req.headers}) Furthermore, the handler accepts a const NoIntrospection = require('graphql-disable-introspection');
app.use('/graphql', createHandler({validationRules: [NoIntrospection]}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i tried to look for how to migrate express-graphql to graphql-http with req function but i couldn't find anything in github or online.
here is the example:
graphqlhttp version
app.use('/graphql', graphqlHTTP(req => {context: req.headers,})
i tried to do the same method for createHandler but its not reading the function.
app.use('/graphql', createHandler(req => {context: req.headers})
Also, does anyone knows if graphql-http can use const NoIntrospection = require('graphql-disable-introspection'); for validationRules in express-graphql?
Thank you in advance
Beta Was this translation helpful? Give feedback.
All reactions