This is a starter kit for a GraphQL server to be federated using Apollo.
$ yarn
$ yarn configure-hooks
Then, create a .env
file. You can duplicate the contents from .env.example
.
To update the database schemas, you can run the codegen command:
$ yarn codegen
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
$ 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
$ yarn test