In order to mock Alfie GraphQL API we created a JavaScript script that creates a server - using Apollo Server - to listen to requests and mock required responses.
As a first step please consider reading the following documentation
https://graphql.com/learn/what-is-graphql/
https://www.apollographql.com/docs/apollo-server/
https://www.apollographql.com/docs/apollo-server/schema/schema
Where initialisation of either server - with the respective schema and mocks are done
Where node dependencies are handled
Schema's files
We will assume that you have already cloned the project and have node/npm already available on your computer. If not please do that before going further.
- Install dependencies
npm install apollo-server graphql
- Initialize server (do the following cmd on the root of the project)
node index.js
- Server available at http://localhost:4000 - if you paste this URL in a browser you will see Apollo testing screen