graphql-hive / graphql-hive/console

Support stricter schema publish for Federation (e.g. `hive schema:publish --strict`)

Open
#7,588 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
483
Forks
145
Avg merge
2d 5h
Merged PRs (30d)
65

Description

Today, we allow all schema/service publishes to a federation project, even if the published service/schema would result in a broken composition state. The reason for this is to not block complicated deployments that require otherwise to publish different services multiple times to get to the desired composed schema state.

We recommend instead for users to run `hive schema:check` before doing the `hive schema:publish` command. This solution has some flaws as in a project with many services race conditions can occur between the check and publish command execution.

In order to bridge that gap we can introduce a `--strict` flag to the `hive schema:publish` command that will cause the service schema to be rejected if the composition would not result in a composable state, resulting in no new schema version being published.

Alternatively/in addition to that, we could also provide target configuration to enable that behaviour implicitly for the whole target and allow admins to temporarily disable/opt-out of it in a scenario where multiple schemas need to be deployed in sequence.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.