This is a simple GraphQL demo showcasing how to set up a server using Apollo Server and Express. In this demo, we have a list of books and authors, and you can query the data using GraphQL queries.
-
Clone the repository
git clone <repository-url> cd graphql-demo
-
Install Dependencies
npm install
To start the server, run the following command:
```bash
node server.js
```
The server will start, and you can access the Apollo Server Playground at http://localhost:4000/graphql.
Once the server is running, you can use the Playground or any GraphQL client to test the API. Run the following queries in the playground.
-
Fetch all books with their authors
{ books { title author { name } } }
-
Fetch all authors and their books
{ authors { name books { title } } }