The Hive CLI can now reject a Federation schema publication when the proposed subgraph causes a composition error.
By default, Hive records an invalid schema version when a subgraph does not compose. This keeps a complete schema history while the Hive CDN continues serving the latest valid supergraph. Some teams instead need the publication to fail without changing schema history, particularly during deployment.
Reject Invalid Publications
Pass --fail-on-composition-error to hive schema:publish:
Hive composes the proposed subgraph before recording the publication. If the supergraph or one of the target’s contracts fails to compose, the command exits with an error and Hive does not create the invalid schema version.
This option only applies to Federation projects. It is opt-in, so existing publication workflows continue to record invalid schema versions unless the flag is provided.
Fail Deployment on Composition Errors
Use the flag when publishing during deployment to stop the pipeline if the deployed subgraph cannot be included in the target’s supergraph:
Continue to run hive schema:check in pull requests. The publish safeguard protects the deployment
boundary from composition failures caused by changes that landed after the check or by concurrent
subgraph releases.
