Question for backend
Asked by Abdul Sami about 4 months ago
my question is this can i use node.js and graphQl API with node.js and mongodb without using express.js
- Set up a basic Node.js server using the
graphql-jsto build your GraphQL schema.
- Create a resolver to interact with MongoDB using the
- Handle the HTTP requests to the GraphQL endpoint.
Absolutely you can do it. You can use the
http module in Node.js to create a server and integrate it with a GraphQL library like
graphql-js. For interfacing with MongoDB, the
mongodb Node.js driver can be used directly.
Here’s a simplified step-by-step approach:
Relevant documentation links: