Join us for GraphQL Summit, October 10-12 in San Diego. Use promo code ODYSSEY for $400 off your pass.
Launch GraphOS Studio

Rover conventions

These are conventions for all commands.


Graph / Subgraph / Supergraph

provides commands for interacting with federated subgraphs and supergraphs, along with commands for interacting with a monolithic (non-federated) graph.

A supergraph is the composition of multiple subgraphs in a federated architecture:

Supergraph (A + B + C)
Subgraph A
Subgraph B
Subgraph C

When working on a federated graph, you'll run most commands on a particular (using a subgraph command), rather than on the whole composed . The supergraph commands are useful when working with supergraph schemas.

Graph refs

uses graph refs to refer to a particular of a particular graph in GraphOS. A graph ref is a string with the following format:


For example: docs-example-graph@staging

All commands that interact with require a graph ref as their first positional .


Using stdout

commands print to stdout in a predictable, portable format. This enables output to be used elsewhere (such as in another CLI, or as input to another command). To help maintain this predictability, Rover prints progress logs to stderr instead of stdout.

To redirect 's output to a location other than your terminal, you can use the --output <OUTPUT_FILE> , the pipe | operator, or the redirect > operator.

Pipe |

Use the pipe operator to pass the stdout of one command directly to the stdin of another, like so:

rover graph introspect http://localhost:4000 | pbcopy

In this example, the output of the introspect command is piped to pbcopy, a MacOS command that copies a value to the clipboard. Certain commands also accept values from stdin, as explained in Using stdin.

Output to a file

Use the --output <OUTPUT_FILE> to write command output to a file.

rover graph fetch my-graph@prod --output schema.graphql

In this example, the returned by graph fetch is written to the file schema.graphql. If this file already exists, it's overwritten. Otherwise, it's created.

Using stdin

commands that take a file path as an option can instead accept input from stdin. To do so, pass - as the for the file path:

rover graph introspect http://localhost:4000 | rover graph check my-graph --schema -

In this example, the returned by graph introspect is then passed as the --schema option to graph check.

Privacy and data collection
Edit on GitHubEditForumsDiscord