How to create one route for receiving non graphql post requests?
See original GitHub issueAnd configure body-parser for it, to access req.body params? So i have my graphql server, and want to receive some non graphql data on it, and get req.body.
server.express.post('/rout',bodyParser.json(), bodyParser.urlencoded({ extended: true }), function(err, req, res, next){
const params = req.body;
})
I can accesss req.body like in the code sample. But what if i want to enable the bodyParser to several routes?
How can i access the ctx.db.query
or ctx.db.mutation
from this route?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:10
Top Results From Across the Web
How to create one route for receiving non graphql post ...
So i have my graphql server, and want to receive some non graphql data on it, and get req.body. server.express.post('/rout',bodyParser.json(), ...
Read more >Serving over HTTP - GraphQL
Your GraphQL HTTP server should handle the HTTP GET and POST methods. GET request#. When receiving an HTTP GET request, the GraphQL query...
Read more >How to create one route for receiving REST API post requests?
I have my graphql server, and want to receive some non graphql data on it. const server = new GraphQLServer({ ... }) server.express.get('/route' ......
Read more >How to receive REST API post requests (non GraphQL)?
How to create one route for receiving non graphql post requests ? I have my graphql server, and want to receive some non...
Read more >4 Simple Ways to Call a GraphQL API
Let's check out the code: require('isomorphic-fetch'); fetch('http://localhost:4000', { method: 'POST', headers: { 'Content-Type': 'application ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@triesa @mubaidr For me registering custom express router(s) after the graphql server has started works.
Perhaps this is going to help someone