# graphql-collaborator

## Prerequisites

1. Make sure you have [nvm](https://github.com/nvm-sh/nvm/blob/master/README.md) and [yarn](https://yarnpkg.com/) installed.
2. We are using private npm packages from our [monorepo](https://github.com/theorchard/orchard-suite) and packagecloud.io registry.
   That means you need a valid access token for each of them.
   Follow this guide on how to setup NPM access.
   https://www.notion.so/Javascript-Package-Management-Setup-9553d5d491c94835aa787fdf0fc4838d
3. Familiarize yourself with [GraphQL at The Orchard](https://github.com/theorchard/docs/tree/master/graphql) before contributing!

## Setup

```bash
# use supported node version
nvm use

# install dependencies
yarn

# create environment configuration
cp .env.shadow .env

# start your server
yarn start
```

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.
Open http://localhost:8080/graphql to view the playground in the browser.
The server will reload if you make edits.

**NOTE:**
**Running the project locally requires an active VPN connection.**

### `yarn test:unit --watch`

Runs the jest unit tests in watch mode. In watch mode type `p` to enter a filter.

### `yarn test:integration`

Runs the jest integration tests against a local instance. **Note** that you need to run `yarn start` in a different process first.

### `yarn test`

Runs unit and integration tests. Run this before creating a PR.

### `yarn lint`

Runs the js and graphql schema linter. Run this before creating a PR.

### `yarn build`

Builds the app for production to the `build` folder.<br />

Note that this command is not required to run locally, it is run during the docker build steps.
