Rover contract commands
For use with Apollo Contract variants
A contract is a variant that is the result of filtering out schema elements from a source variant.
Rover commands that interact with contracts begin with rover contract
.
Publishing a contract to Apollo Studio
contract publish
This command requires authenticating Rover with Apollo Studio.
You can use Rover to publish a new contract or publish configuration changes to an existing contract.
Run the contract publish
command, like so:
rover contract publish my-graph@my-contract-variant \--source-variant my-source-variant \--include-tag foo \--include-tag bar \--exclude-tag baz \--hide-unreachable-types
The argument my-graph@my-contract-variant
in the example above is a graph ref that specifies the ID of the Studio graph you're publishing to, along with which variant you're publishing to.
If this variant already exists in the graph registry, its configuration is updated; otherwise, a new contract variant is created.
Options include:
Name | Description |
---|---|
| The name of the source variant whose supergraph schema is used for filtering. The source variant must be on the same graph as the contract variant and cannot be changed after contract creation. It must also be a federated variant with subgraphs. If your graph is using Federation 1, support for the Required the first time you publish a contract. Optional after your first publish, but if provided it must match the previously published source variant in Studio. |
| Required unless Every tag name must:
|
| Required unless |
| Required unless Every tag name must:
|
| Required unless |
| Required unless |
| Required unless |
| Optional. Do not trigger a launch in Studio after updating the contract configuration |
Describing a contract variant
contract describe
This command requires authenticating Rover with Apollo Studio.
You can use Rover to describe the configuration of any contract variant that Rover has access to.
Run the contract describe
command, like so:
rover contract describe my-graph@my-contract-variant
The argument my-graph@my-contract-variant
in the example above is a graph ref that specifies the ID of the Studio graph you're fetching from, along with which variant you're fetching.
The output will contain information of how the contract variant was configured such as the source variant, include and exclude tags.
Fetching description for configuration of my-graph@my-contract-variant using credentials from the default profile.Configuration Description:Contract variant "my-graph@my-contract-variant" is derived from the source variant "my-graph@my-source-variant".Included tags:- "foo"- "bar"Excluded tags:- "baz"Unreachable types are automatically hidden.View the variant's full configuration at https://studio.apollographql.com/graph/my-graph/settings/variant?variant=my-contract-variant