Skip to content

This repo is part of Alfie: a project to boostrap eCommerce Projects (Front-end mobile/web and BE and Graph APIs)

License

Notifications You must be signed in to change notification settings

Mindera/Alfie-Mocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alfie GraphQL Mock Server

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.

Onboarding

As a first step please consider reading the following documentation

GraphQL

https://graphql.com/learn/what-is-graphql/

Apollo Server

https://www.apollographql.com/docs/apollo-server/

Schema

https://www.apollographql.com/docs/apollo-server/schema/schema

Structure

index.js

Where initialisation of either server - with the respective schema and mocks are done

package.json

Where node dependencies are handled

*.graphqls

Schema's files

Running Mock Server

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.

  1. Install dependencies
npm install apollo-server graphql
  1. Initialize server (do the following cmd on the root of the project)
node index.js
  1. Server available at http://localhost:4000 - if you paste this URL in a browser you will see Apollo testing screen

About

This repo is part of Alfie: a project to boostrap eCommerce Projects (Front-end mobile/web and BE and Graph APIs)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •