Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: adds async checks docs #1193

Merged
merged 9 commits into from
Jul 28, 2022
10 changes: 7 additions & 3 deletions docs/source/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
echo 'export PATH=$HOME/.rover/bin:$PATH' >> $BASH_ENV
- checkout
# after rover is installed, you can run it just like you would locally!
- run: rover graph check my-graph@prod --schema ./schema.graphql
# only run this command with the `--background` flag if you have the Apollo Studio GitHub integration enabled on your repository
- run: rover graph check my-graph@prod --schema ./schema.graphql --background
```

## GitHub Actions
Expand Down Expand Up @@ -124,9 +125,10 @@ jobs:
# Add Rover to the $GITHUB_PATH so it can be used in another step
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
echo "$HOME/.rover/bin" >> $GITHUB_PATH
# only run this command with the `--background` flag if you have the Apollo Studio GitHub integration enabled on your repository
- name: Run check against prod
run: |
rover graph check my-graph@prod --schema ./test.graphql
rover graph check my-graph@prod --schema ./test.graphql --background

```

Expand Down Expand Up @@ -283,8 +285,10 @@ If you're running in a Node.js workflow, it might be easier to use the [NPM dist

You can use Rover by adding it to your `package.json` dependencies using [these instructions](./getting-started#npm-installer) and then execute it using npm scripts, similar to other workflows you might already have. If you don't want to install Rover as a dependency, you can run it with `npx` by using the `-p` flag:

> **Note:** Only run this command with the `--background` flag if you have the Apollo Studio GitHub integration enabled on your repository.

```bash
npx -p @apollo/rover rover graph check my-graph@prod --schema=./schema.graphql
npx -p @apollo/rover rover graph check my-graph@prod --schema=./schema.graphql --background
```

Since most commands require you be authenticated, see the above sections for instructions on how to add environment variables for your CI/CD provider.
6 changes: 6 additions & 0 deletions docs/source/commands/graphs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ As shown, arguments and options are similar to [`graph publish`](#graph-publish)

To configure the behavior of schema checks (such as the time range of past operations to check against), see the [documentation for schema checks](/studio/check-configurations/#using-apollo-studio-recommended).

If you don't want to wait for the check to complete, you can run the command with the `--background` flag. You can then look up the check's result in Apollo Studio on the Checks tab.

#### Running checks in CI

If you're running schema checks in CI, you might want to pass the `--background` flag to `rover graph check`. This flag instructs Rover to initiate schema checks but _not_ await their result. If you've [connected Apollo Studio to your GitHub repository](/studio/github-integration/), the integration detects the checks execution and adds a status to the associated pull request.

## Deleting a variant

### `graph delete`
Expand Down
6 changes: 6 additions & 0 deletions docs/source/commands/subgraphs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ As shown, arguments and options are similar to [`subgraph publish`](#subgraph-pu

To configure the behavior of schema checks (such as the time range of past operations to check against), see the [documentation for schema checks](/studio/check-configurations/#using-apollo-studio-recommended).

If you don't want to wait for the check to complete, you can run the command with the `--background` flag. You can then look up the check's result in Apollo Studio on the Checks tab.

#### Running checks in CI

If you're running schema checks in CI, you might want to pass the `--background` flag to `rover subgraph check`. This flag instructs Rover to initiate schema checks but _not_ await their result. If you've [connected Apollo Studio to your GitHub repository](/studio/github-integration/), the integration detects the checks execution and adds a status to the associated pull request.

## Deleting a subgraph

### `subgraph delete`
Expand Down