codedamn

Question for backend

Asked by Abdul Sami about 4 months ago

0

my question is this can i use node.js and graphQl API with node.js and mongodb without using express.js

1 Answer

    0

    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:

    1. Set up a basic Node.js server using the http module.
    2. Use graphql-js to build your GraphQL schema.
    3. Create a resolver to interact with MongoDB using the mongodb driver.
    4. Handle the HTTP requests to the GraphQL endpoint.

    Relevant documentation links:

    @pranavtechie

    Pranav Mandava

    @pranavtechie

Your answer