Skip to content

Latest commit

 

History

History
71 lines (46 loc) · 1.29 KB

README.md

File metadata and controls

71 lines (46 loc) · 1.29 KB

api-starter-kit

This is a starter kit for a GraphQL server to be federated using Apollo.

Installation

$ yarn
$ yarn configure-hooks

Then, create a .env file. You can duplicate the contents from .env.example.

Codegen

To update the database schemas, you can run the codegen command:

$ yarn codegen

Setup for local development

First, start the database in a terminal tab (you'll need Docker on your machine):

$ docker-compose up

Then, migrate the database to the current schema:

$ yarn setup
Reset local database

You can reset your local database using the following command (careful, this is destructive).

$ yarn reset

Start development server

$ yarn dev

You can then open https://localhost:3000/graphql and try the explorer.

You can preview all the subgraphs you expose (e.g. https://localhost:3000/partner-graphql, https://localhost:3000/internal-graphql).

If you need a token to simulate authentication, you can use the get-test-token command:

$ yarn get-test-token user
$ yarn get-test-token project
$ yarn get-test-token project-member

Run tests

$ yarn test