Skip to content

Commit

Permalink
docs: encourage setting APOLLO_GRAPH_ID (#5226)
Browse files Browse the repository at this point in the history
Part of #5157.
  • Loading branch information
glasser committed May 20, 2021
1 parent d6b1bd4 commit 892f359
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/api/apollo-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ Provide this function to transform the structure of GraphQL response objects bef
An object containing configuration options for connecting Apollo Server to [Apollo Studio](https://www.apollographql.com/docs/studio/). Each field of this object can also be set with an environment variable, which is the recommended method of setting these parameters. All fields are optional. The fields are:

- `key`: The [graph API key](https://www.apollographql.com/docs/studio/api-keys/#graph-api-keys) that Apollo Server should use to authenticate with Apollo Studio. You can set this with the `APOLLO_KEY` environment variable.
- `graphId`: The ID of your graph in Apollo's registry. You can set this with the `APOLLO_GRAPH_ID` environment variable. Most users will not specify this explicitly and allow Apollo Server to infer the ID from your API key.
- `graphId`: The ID of your graph in Apollo's registry. You can set this with the `APOLLO_GRAPH_ID` environment variable.
- `graphVariant`: The [variant](https://www.apollographql.com/docs/studio/schema/registry/#managing-environments-with-variants) of your graph to associate this server's schema and metrics with. You can set this with the `APOLLO_GRAPH_VARIANT` environment variable. The default value is `current`.

</td>
Expand Down
4 changes: 2 additions & 2 deletions docs/source/monitoring/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ Apollo Server integrates seamlessly with Apollo Studio to help you monitor the e

To connect Apollo Server to Apollo Studio, first [obtain a graph API key](https://www.apollographql.com/docs/studio/setup-analytics/#pushing-traces-from-apollo-server). To provide this key to Apollo Server, assign it to the `APOLLO_KEY` environment variable in your server's environment.

Similarly, you can associate your server instance with a particular [graph variant](https://www.apollographql.com/docs/studio/schema/registry/#managing-environments-with-variants) by setting the `APOLLO_GRAPH_VARIANT` environment variable.
Then associate your server instance with a particular graph ID and [graph variant](https://www.apollographql.com/docs/studio/schema/registry/#managing-environments-with-variants) by setting the `APOLLO_GRAPH_ID` and `APOLLO_GRAPH_VARIANT` environment variables.

You can set environment variable values on the command line as seen below, or with the [`dotenv` npm package](https://www.npmjs.com/package/dotenv) (or similar).

```bash
# Replace the example values below with values specific to your use case.
APOLLO_KEY=YOUR_API_KEY APOLLO_GRAPH_VARIANT=development node start-server.js
APOLLO_KEY=YOUR_API_KEY APOLLO_GRAPH_ID=mygraph APOLLO_GRAPH_VARIANT=development node start-server.js
```

### Identifying distinct clients
Expand Down

0 comments on commit 892f359

Please sign in to comment.