feat: merge queue schema checks - #8327
Open
n1ru4l wants to merge 38 commits into
Open
Conversation
Collaborator
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-hive/cli |
0.62.0-alpha-20260818092454-058febc6189a7772d6921bd01041285dcae4779a |
npm ↗︎ unpkg ↗︎ |
hive |
11.12.0-alpha-20260818092454-058febc6189a7772d6921bd01041285dcae4779a |
npm ↗︎ unpkg ↗︎ |
Contributor
|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tags: |
n1ru4l
marked this pull request as ready for review
August 6, 2026 09:49
n1ru4l
marked this pull request as draft
August 6, 2026 09:49
n1ru4l
force-pushed
the
feat-github-merge-queue-base-schema
branch
2 times, most recently
from
August 10, 2026 10:33
1a2a9fb to
1a3d526
Compare
n1ru4l
force-pushed
the
feat-github-merge-queue-base-schema
branch
4 times, most recently
from
August 13, 2026 12:56
fe3dc43 to
b9e62f3
Compare
…ck business logic for composite schema projects to compose the public schema using the base schema when provided and then use that for creating the schema change diff
…) on schema checks and contract checks for providing a proper baseline. Base schema in combination with checksum skip check currently raises an invariant.
n1ru4l
force-pushed
the
feat-github-merge-queue-base-schema
branch
from
August 17, 2026 11:12
789a60a to
1c2ce7d
Compare
n1ru4l
force-pushed
the
feat-github-merge-queue-base-schema
branch
from
August 17, 2026 11:22
b27a097 to
4ca0d03
Compare
n1ru4l
marked this pull request as ready for review
August 18, 2026 07:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves schema checks for GitHub merge queues.
The Problem
Breaking changes are approved only within the context of a single pull request. This prevents unintended "global" approvals overlaps with other open/outdated pull requests.
Merge queue actions runs are composed of multiple pull request commits:
Without an explicit baseline, changes introduced and approved by an earlier pull request can be reported again when checking a later merge queue item. Because the later check uses a different pull request context, those changes are considered unapproved.
The solution
Adds a
--baselineoption tohive schema:check. The baseline service schema can be loaded from:<sha>:<file>syntaxhive schema:check \ --target the-guild/hive-console/development \ --baseline 43e728ea9:schema.graphqls \ --service products \ --contextId "hive-console#67" \ schema.graphqlsExample for Github Action
Full GitHub Action Yaml Flow
The provided service schema is composed into a baseline supergraph using the remaining registry state (subgraphs), which is then compared against the proposed schema composed supergraph. This ensures that each merge queue item reports only the changes introduced relative to its intended baseline.
Implementation Notes
Failing baseline composition
A schema check will fail if the base composition fails, as we cannot create a schema change diff in that case:

A manual approval is also blocked if the baseline composition fails.
Skipping baseline composition
In case the registry (service) state is identical to the baseline state, we can safely skip the composition of the baseline and safe some computation power.
--githubflagThe
hive schema:check --githubflag, can now detect when dispatched by a merge queue event and automatically extracts the pull request number (used for constructing the context id) fromevent.merge_group.head_refand base sha (used as additional meta information) fromevent.merge_group.base_shaand passes it along to the server.I set up a demo over here: https://github.com/graphql-hive/hive-cli-github-merge-queue-demo, the workflow file shows how this new feature is intended to be used in Github Actions: https://github.com/graphql-hive/hive-cli-github-merge-queue-demo/blob/main/.github/workflows/ci.yml
Other
Closes #8326
Documentation graphql-hive/docs#158