You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-4Lines changed: 5 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ This repository contains a sample validation service for GraphOS [custom schema
10
10
This example implementation deploys a [Netlify function](https://www.netlify.com/platform/core/functions/) that can be used to set up a webhook integration with GraphOS [schema checks](https://www.apollographql.com/docs/graphos/delivery/schema-checks).
11
11
12
12
This example Netlify function does the following:
13
+
13
14
- Receives the [webhook payload](http://localhost:3000/graphos/delivery/custom-checks#webhook-format) from GraphOS.
14
15
- Validates the HMAC value in the `x-apollo-signature` header.
15
16
- Downloads the composed supergraph.
@@ -23,13 +24,13 @@ After building and deploying the function, you need to [enable custom schema che
23
24
1. Set up a Netlify account, then install and authenticate with [Netlify CLI](https://docs.netlify.com/cli/get-started/).
24
25
1. Install dependencies and build function code. `$ npm install ; npm run build`
25
26
1. To deploy to Netlify, follow the CLI instructions for creating and configuring a new site. `$ netlify deploy`
26
-
- When asked for the publish directory, use the default root directory. The `netlify.toml` file has a pointer to the `dist/` to upload the built function.
27
+
- When asked for the publish directory, use the default root directory. The `netlify.toml` file has a pointer to the `dist/` to upload the built function.
27
28
1. Pull up site you created in the [Netlify web console](https://app.netlify.com/).
28
29
1. In the Netlify console, go to **Site configuration > Environment variables**. Add and upload values for the environment variables: `APOLLO_HMAC_TOKEN` and `APOLLO_API_KEY`.
29
-
- The `APOLLO_HMAC_TOKEN` should be any string that will be used to calculate the `x-apollo-signature header`.
30
-
- The `APOLLO_API_KEY` is a [GraphOS API key](https://www.apollographql.com/docs/graphos/api-keys/) with sufficient permissions to run schema checks for the graph you're integrating this application with.
30
+
- The `APOLLO_HMAC_TOKEN` should be any string that will be used to calculate the `x-apollo-signature header`.
31
+
- The `APOLLO_API_KEY` is a [GraphOS API key](https://www.apollographql.com/docs/graphos/api-keys/) with sufficient permissions to run schema checks for the graph you're integrating this application with.
31
32
1. Deploy the function to production. `$ netlify deploy --prod`
32
33
1. From your terminal, copy the **Website URL** plus the path `/custom-lint` and go to [GraphOS Studio](https://studio.apollographql.com/).
33
34
1. In the graph you're integrating this with go to **Checks > Configuration** and enable custom checks, registering the function URL and entering your `APOLLO_HMAC_TOKEN` as the secret token.
34
35
1. Run a schema check using the [Rover CLI](https://www.apollographql.com/docs/rover/) to test the integration.
35
-
- You should see check results in GraphOS Studio on the **Checks** page. You can also verify logs in the Netlify console.
36
+
- You should see check results in GraphOS Studio on the **Checks** page. You can also verify logs in the Netlify console.
0 commit comments