Loading...
Loading...
Guide for using Apollo Rover CLI to manage GraphQL schemas and federation. Use this skill when: (1) publishing or fetching subgraph/graph schemas, (2) composing supergraph schemas locally or via GraphOS, (3) running local supergraph development with rover dev, (4) validating schemas with check and lint commands, (5) configuring Rover authentication and environment.
npx skill4agent add apollographql/skills rover# macOS/Linux
curl -sSL https://rover.apollo.dev/nix/latest | sh
# npm (cross-platform)
npm install -g @apollo/rover
# Windows PowerShell
iwr 'https://rover.apollo.dev/win/latest' | iex# Interactive authentication (opens browser)
rover config auth
# Or set environment variable
export APOLLO_KEY=your-api-keyrover --version
rover config whoami| Command | Description | Use Case |
|---|---|---|
| Publish subgraph schema to GraphOS | CI/CD, schema updates |
| Validate schema changes | PR checks, pre-deploy |
| Download subgraph schema | Local development |
| Compose supergraph locally | Local testing |
| Local supergraph development | Development workflow |
| Publish monograph schema | Non-federated graphs |
<GRAPH_ID>@<VARIANT>my-graph@productionmy-graph@stagingmy-graph@currentexport APOLLO_GRAPH_REF=my-graph@production# From schema file
rover subgraph publish my-graph@production \
--name products \
--schema ./schema.graphql \
--routing-url https://products.example.com/graphql
# From running server (introspection)
rover subgraph publish my-graph@production \
--name products \
--schema <(rover subgraph introspect http://localhost:4001/graphql) \
--routing-url https://products.example.com/graphql# Check against production traffic
rover subgraph check my-graph@production \
--name products \
--schema ./schema.graphql# Fetch from GraphOS
rover subgraph fetch my-graph@production --name products
# Introspect running server
rover subgraph introspect http://localhost:4001/graphqlsupergraph.yamlfederation_version: =2.9.0
subgraphs:
products:
routing_url: http://localhost:4001/graphql
schema:
file: ./products/schema.graphql
reviews:
routing_url: http://localhost:4002/graphql
schema:
subgraph_url: http://localhost:4002/graphqlrover supergraph compose --config supergraph.yaml > supergraph.graphqlrover supergraph fetch my-graph@productionrover dev# Start with supergraph config
rover dev --supergraph-config supergraph.yaml
# Start with GraphOS variant as base
rover dev --graph-ref my-graph@staging --supergraph-config local.yaml# Start with MCP server enabled
rover dev --supergraph-config supergraph.yaml --mcp# 1. Check schema changes
rover subgraph check $APOLLO_GRAPH_REF \
--name $SUBGRAPH_NAME \
--schema ./schema.graphql
# 2. If check passes, publish
rover subgraph publish $APOLLO_GRAPH_REF \
--name $SUBGRAPH_NAME \
--schema ./schema.graphql \
--routing-url $ROUTING_URL# Lint against GraphOS rules
rover subgraph lint --name products ./schema.graphql
# Lint monograph
rover graph lint my-graph@production ./schema.graphql# JSON output for scripting
rover subgraph fetch my-graph@production --name products --format json
# Plain output (default)
rover subgraph fetch my-graph@production --name products --format plainrover config authAPOLLO_KEYgraph-id@variantrover subgraph checkrover subgraph publishrover devAPOLLO_KEY--format jsonfederation_versionrover subgraph introspect