Schedule icon
Request icon
Script icon
Docker icon
If icon
SlackIncomingWebhook icon

GraphQL multi-environment schema parity and drift sentinel

Compare GraphQL schemas between staging and production environments via introspection, detecting type or field drift before customer-impacting releases.

Categories
CloudInfrastructure

Automates cross-environment schema audits by introspecting primary (staging/UAT) and reference (production) GraphQL gateways, computing structural type and field diffs in Python, and alerting API platform teams via Slack to prevent schema drift.

What you get

  • Automated detection of unpromoted types or missing fields before deploying client applications.
  • Full introspection parsing comparing Object, Interface, and Union types across environments.
  • Contextual Slack alerts detailing added types, removed types, and field variations.
  • Elimination of broken mobile and frontend clients caused by unexpected schema differences.

Who it's for

  • API Platform Engineers managing GraphQL gateways and Apollo Federation federated subgraphs.
  • DevOps and Release Engineers validating pre-production readiness before major releases.
  • Frontend and Mobile Engineers dependent on consistent GraphQL contracts between environments.

Why orchestrate this with Kestra

Verifying that Staging and Production schemas remain in sync usually requires manually running CLI tools like rover or graphql-inspector. Kestra runs scheduled, native GraphQL introspection requests against both endpoints simultaneously, performs deterministic diffing inside an isolated Python runtime, and dispatches drift alerts directly to engineering channels with zero local tooling setup.

Prerequisites

  • Network connectivity to both primary (staging) and reference (production) GraphQL endpoints.
  • A Slack Incoming Webhook URL configured for platform alerts.

Secrets

  • PRIMARY_GRAPHQL_TOKEN: Bearer token or API key for the primary (staging) GraphQL gateway.
  • REFERENCE_GRAPHQL_TOKEN: Bearer token or API key for the reference (production) GraphQL gateway.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook URL used to deliver schema drift reports.

Quick start

  1. Define PRIMARY_GRAPHQL_TOKEN, REFERENCE_GRAPHQL_TOKEN, and SLACK_WEBHOOK_URL in Kestra Secrets.
  2. Set primary_graphql_endpoint and reference_graphql_endpoint to your respective gateway URLs.
  3. Trigger a manual execution from the Kestra UI to run the comparison and review output variables.
  4. Enable the pre_release_parity_schedule trigger to audit schema parity every weekday morning.

How to extend

  • Fail pre-production CI/CD deployment pipelines using Kestra execution return statuses if unexpected drift is detected.
  • Generate schema diff snapshots and save them to AWS S3, Google Cloud Storage, or MinIO for compliance auditing.
  • Add automated schema registry synchronizations to push updated definitions to Apollo Studio or Hive.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.