This project demonstrates how to use GraphQL to fetch data from two different REST APIs, merge the results, and expose a unified API for frontend consumption.
- Fetches data from two separate APIs.
- Merges the responses into a single structured output.
- Exposes a GraphQL endpoint for frontend requests.
- Node.js
- Express.js
- Apollo Server (GraphQL)
- Axios (for fetching external APIs)
- Clone the repository:
https://github.com/Arnab7456/Graphql.git
cd Graphql-
Install dependencies:
yarn
-
Start the server:
yarn index.js
-
Access GraphQL Playground at:
http://localhost:3000/graphql
query GetAllTodos{
getTodo {
title
completed
user {
name
email
phone
}
}
}https://jsonplaceholder.typicode.com/todos/https://jsonplaceholder.typicode.com/users
MIT