Setting up Graphql Server
This tutorial is based on https://www.apollographql.com/docs/apollo-server/getting-started/ Install node and npm. If you don't have them installed do the following 1 and 2: 1. Install homebrew from https://brew.sh/ 2. Install node and npm using homebrew Create a new folder named graphql-server-example cd into it. setup node project using the command: npm init --yes This creates a package.json file. Install apollo-server and graphql using: npm install apollo-server graphql Create an empty index.js file with command touch index.js Add the following content to the file: const { ApolloServer , gql } = require ( 'apollo-server' ); // A schema is a collection of type definitions (hence "typeDefs") // that together define the "shape" of queries that are executed against // your data. const typeDefs = gql ` # Comments in GraphQL strings (such as this one) start with the hash (#) symbol. # This "Book" type defines the queryable field