rover
rover copied to clipboard
Support `rover supergraph fetch` for contract variants
From a customer:
When using rover supergraph fetch <variant_graph_ref>
it fails saying:
error[E007]: The graph `customer@contract-variant` is a non-federated graph. This operation is only possible for federated graphs.
Try running the command on a valid federated graph, or use the appropriate `rover graph` command instead of `rover subgraph`.
The use case is fetching the supergraph schema to use in an Uplink fallback. They need the contract supergraph with all the @inaccessible
directives applied.
@jsegaran and @david-castaneda are working on an API change that should make this possible.
I can confirm that our remote API doesn't yet support contract variants! Once that lands, this will just start working right? With no changes on Rover?
@lennyburdette @abernix The API for fetching the latest approved schema should be ready for use.
This query should work for regular variants and contract variants.
query {
service(id: "") {
variant(name: "") {
latestApprovedLaunch {
build {
result {
... on BuildSuccess {
coreSchema {
apiDocument
coreDocument
}
}
}
}
}
}
}
}
hey @david-castaneda - would love to accept a PR that uses this new query!
@david-castaneda will latestApprovedLaunch
always be a successful launch?
Yep. The latest approved launch contains the schema that is being used by uplink for running gateways/routers.
Yep. The latest approved launch contains the schema that is being used by uplink for running gateways/routers.
This works now.