Apollo Enterprise: Schema Change Webhooks
Josh Segaran
tl;dr Apollo Studio Enterprise announces support for Schema Change Webhooks
As GraphQL developers, all of our data is communicated through the GraphQL schema. With the release of schema change Slack notifications in 2020, we made it easier than ever to keep everyone working around your graph up-to-date with schema changes through Slack. Expanding on the functionality to connect your graph’s schema to your workspace, we are excited to announce the addition of schema change webhooks to Apollo Studio Enterprise. With webhooks, you and your team can build whatever automation is relevant to your workflow, whether that be automating pull requests to client & server codebases, running linting tests, generating email notifications, or creating a personalized change-log. The possibilities are yours to enumerate. Setting up schema change webhooks will require:
- An Apollo Enterprise subscription
- Configuration in Apollo Studio
- An exposed endpoint to handle the webhook payload
Every time your graph variant’s published schema changes, your configured webhook listener will receive a JSON payload like so:
{ "eventType": "SCHEMA_PUBLISH", "eventID": "6190b556-457e-4669-b933-8b66aa9b8764", "changes": [ { "description": "field `Amazon.referrer`: type `String!` changed to `String`" } ], "graphID": "acephei", "schemaURL": "https://graphql.api.apollographql.com/schema-link?token=6fb35434a55b966f81c0e07a8f93327029d", "schemaURLExpiresAt": "2021-01-26T20:05:28.856Z", "timestamp": "2021-01-25T20:05:28.081Z", "variantID": "acephei@prod" }
Configuring a new webhook notification is a few clicks in Apollo Studio. Navigate to the notifications tab in your graph’s Settings page and click Add Notification
to get started. For a walk-through, take a look at the dedicated Studio Notifications docs.
To handle a webhook notification, you’ll expose an endpoint that can consume the JSON payload. We have an example Node.JS server for you to run to handle this event here: https://github.com/jsegaran/apollo-schema-change-webhook. Alternatively, it’s simple to get up and running with a custom Zapier integration or whatever your favorite workflow automation tool may be. To learn more about schema change webhooks and the other functionality that comes with Apollo Enterprise, reach out to Apollo!