Build Status Notifications
Receive webhook alerts whenever GraphOS attempts to build a new supergraph schema
Configure GraphOS to send notifications to a webhook whenever GraphOS attempts to build a new supergraph schema for your federated graph. Notifications indicate whether the build succeeded. Successful build notifications include a temporary URL to the new supergraph schema.
Setup
- Go to your graph's Settings page in GraphOS Studio.
- Open the Reporting tab.
- Click Add notification in the upper right.
- Select Build Status and click Next.
- In the dropdown, select which graph variant you want to receive notifications for.
- Select either an existing notification channel or select which type of new channel you want to configure. Click Next.
- If you're configuring a new channel, complete the steps in the next section.
Configure webhook
Custom webhooks require you to set up an HTTPS endpoint accessible via
the public internet. GraphOS sends webhook notifications to this
endpoint as POST
requests. Notification details are
provided as JSON in the request body, as described in the next section.
-
Specify a name for this notification channel in the Channel Name field. This name must be unique among all your graph's notification channels, including Slack channels.
In the Webhook URL input, provide the URL of your HTTP(S) endpoint.
Click Next and complete any remaining steps in the dialog.
Webhook format
Custom webhook notification details are provided as a JSON object in the request body.
The JSON object conforms to the structure of the ResponseShape
interface:
1interface BuildError {
2 message: string;
3 locations: ReadonlyArray<Location>;
4}
5
6interface Location {
7 line: number;
8 column: number;
9}
10
11interface ResponseShape {
12 eventType: 'BUILD_PUBLISH_EVENT';
13 eventID: string;
14 supergraphSchemaURL: string | undefined;
15 buildSucceeded: boolean;
16 buildErrors: BuildError[] | undefined;
17 graphID: string;
18 variantID: string;
19 timestamp: string;
20}
Field descriptions
Field | Description |
---|---|
| The build status event name; currently, always BUILD_PUBLISH_EVENT |
| A unique event ID |
| If the build succeeded, a short-lived (24-hour) URL that enables you to fetch the supergraph schema without authenticating (such as with an API key).If the build fails, this field isn't present. |
| Whether or not the build succeeded |
| If the build failed, an array of builderError objects that describe the errors that occurred during the build.If the build succeeded, this field isn't present. |
| A unique graph ID |
| An unique ID in the graph ref format graphID@variantName |
| An ISO 8601 Date string indicating when the event occurred |