rover

작성자: apollographql

Apollo Rover CLI는 GraphQL 스키마, 페더레이션 및 로컬 슈퍼그래프 개발을 관리합니다. 서브그래프 스키마를 게시, 가져오기 및 검증하고, 로컬 또는 GraphOS를 통해 페더레이티드 슈퍼그래프를 구성합니다. 스키마 검사(배포 전 검증), 린팅, 실행 중인 서버에서의 인트로스펙션을 포함합니다. rover dev 명령어는 자동 스키마 구성을 통해 개발 워크플로를 위한 로컬 라우터를 시작합니다. 게시 전 검증 및 JSON 출력을 통한 스크립팅을 지원하는 CI/CD 패턴을 지원합니다. 필요...

npx skills add https://github.com/apollographql/skills --skill rover

Apollo Rover CLI Guide

Rover is the official CLI for Apollo GraphOS. It helps you manage schemas, run composition locally, publish to GraphOS, and develop supergraphs on your local machine.

Quick Start

Step 1: Install

# 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

Step 2: Authenticate

# Interactive authentication (opens browser)
rover config auth

# Or set environment variable
export APOLLO_KEY=your-api-key

Step 3: Verify Installation

rover --version
rover config whoami

Explore a Graph's Schema (start here for schema questions)

To answer "what's in this graph?", find a field, or write a query against a GraphOS graph, fetch the API schema and pipe it into rover schema — this keeps the SDL out of your context and returns only what you need:

# What can I query? (compact overview)
rover graph fetch <graph@variant> | rover schema describe -

# Find a field by concept/keyword (returns the path from a root operation)
rover graph fetch <graph@variant> | rover schema search - "<keyword>"

# Zoom into one type or field
rover graph fetch <graph@variant> | rover schema describe - --coord <Type.field> --depth 1

Three rules that keep this correct:

  • Use rover graph fetch (the API schema) — not rover supergraph fetch (that returns composition SDL with federation internals like join__/link__).
  • Pipe it in — never run rover graph fetch alone and read the raw SDL (a large schema floods your context; that's exactly what rover schema avoids).
  • The schema commands read piped SDL, not a graph refrover schema describe <graph@variant> fails; you must fetch first and pipe.

Full reference, ranking rules, and the save-once pattern: Schema Exploration and references/schema.md.

Core Commands Overview

CommandDescriptionUse Case
rover subgraph publishPublish subgraph schema to GraphOSCI/CD, schema updates
rover subgraph checkValidate schema changesPR checks, pre-deploy
rover subgraph fetchDownload subgraph schemaLocal development
rover supergraph composeCompose supergraph locallyLocal testing
rover devLocal supergraph developmentDevelopment workflow
rover graph publishPublish monograph schemaNon-federated graphs
rover schema describeExplore a schema by coordinate; takes SDL via stdin/file, not a graph ref — pipe from rover graph fetchAgent schema discovery
rover schema searchSearch a schema by keyword; takes SDL via stdin/file, not a graph ref — pipe from rover graph fetchAgent schema discovery

Graph Reference Format

Most commands require a graph reference in the format:

<GRAPH_ID>@<VARIANT>

Examples:

  • my-graph@production
  • my-graph@staging
  • my-graph@current (default variant)

Set as environment variable:

export APOLLO_GRAPH_REF=my-graph@production

Subgraph Workflow

Publishing a Subgraph

# 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

Checking Schema Changes

# Check against production traffic
rover subgraph check my-graph@production \
  --name products \
  --schema ./schema.graphql

Fetching Schema

# Fetch from GraphOS
rover subgraph fetch my-graph@production --name products

# Introspect running server
rover subgraph introspect http://localhost:4001/graphql

Supergraph Composition

Local Composition

Create supergraph.yaml:

federation_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/graphql

Compose:

rover supergraph compose --config supergraph.yaml > supergraph.graphql

Fetch Composed Supergraph

rover supergraph fetch my-graph@production

This returns the supergraph SDL (federation directives + join__/link__ internals) — use it for composition/router work. To explore what you can query or write an operation, use rover graph fetch (the API schema) instead — see Explore a Graph's Schema.

Local Development with rover dev

Start a local Router with automatic schema composition:

# 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

With MCP Integration

# Start with MCP server enabled
rover dev --supergraph-config supergraph.yaml --mcp

Schema Exploration (for Agents)

rover schema describe and rover schema search let an agent explore a schema without loading the full SDL into context — that is the entire point of these commands.

⚠️ Never read the raw SDL into context. Running rover graph fetch <ref> (or rover graph introspect <url>) on its own prints the entire schema — hundreds to tens of thousands of lines — straight into your context, which defeats the purpose of these commands. Always pipe fetch output into rover schema describe/search: the SDL flows through stdin and only the compact overview/results reach you. (Fetching to a file is fine when the user actually wants the SDL.)

These commands also take SDL on stdin or a file, NOT a graph ref — you can't pass graph@variant to them. Fetch first, then pipe:

❌ rover schema describe my-graph@current             # error: looks for a file named that
❌ rover graph fetch my-graph@current                 # dumps the full SDL into your context
✅ rover graph fetch my-graph@current | rover schema describe -

To explore a graph in GraphOS, fetch its schema and pipe it in. Use rover graph fetch (the API schema) for "what can I query?" exploration — it omits federation internals. Reach for rover supergraph fetch only when you need composition details (join__/link__ types, subgraph structure):

# Overview of a GraphOS graph
rover graph fetch my-graph@current | rover schema describe -

# Find fields by keyword (results include paths from root operations)
rover graph fetch my-graph@current | rover schema search - "playback"

# Zoom into a coordinate, expanding referenced types one level
rover graph fetch my-graph@current | rover schema describe - --coord <Type.field> --depth 1

Coordinate forms: --coord accepts a type (User), a field (User.posts), a field argument (Type.field(arg:)), or a directive (@deprecated) — omit it for the overview.

search vs describe: reach for rover schema search first when matching a concept or keyword and you don't yet know the field name — it finds nested fields and shows the path from a root operation. The describe overview lists only root fields, so search is how you locate fields buried deeper. Use describe for the overview or once you know the type/field coordinate.

This enables a closed-loop workflow — search → describe → write a query — with no MCP server setup. See Schema Exploration for the full command reference, ranking rules, and the save-once pattern for large schemas.

Running the generated operation: Rover does not execute queries — it only manages and inspects schemas. To actually run a generated query you need the graph's endpoint:

  • Single-subgraph graph: rover subgraph list <graph@variant> prints the Routing Url — send the query there with curl.
  • Multi-subgraph / federated: the client endpoint is the router URL (find it in GraphOS Studio; for a GraphOS cloud router, rover cloud config fetch <graph@variant>), not the per-subgraph routing URLs.
  • Don't try to discover the endpoint via the GraphOS Platform API — Rover keeps the API key in its profile/keychain, not $APOLLO_KEY, so ad-hoc API calls will come back unauthenticated.

Reference Files

Detailed documentation for specific topics:

  • Subgraphs - fetch, publish, check, lint, introspect, delete
  • Graphs - monograph commands (non-federated)
  • Supergraphs - compose, fetch, config format
  • Dev - rover dev for local development
  • Schema Exploration - describe, search, agent schema discovery workflows
  • Configuration - install, auth, env vars, profiles

Common Patterns

CI/CD Pipeline

# 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

Schema Linting

# Lint against GraphOS rules
rover subgraph lint --name products ./schema.graphql

# Lint monograph
rover graph lint my-graph@production ./schema.graphql

Output Formats

# 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 plain

Ground Rules

  • ALWAYS authenticate before using GraphOS commands (rover config auth or APOLLO_KEY)
  • ALWAYS use the correct graph reference format: graph@variant
  • PREFER rover subgraph check before rover subgraph publish in CI/CD
  • USE rover dev for local supergraph development instead of running Router manually
  • NEVER commit APOLLO_KEY to version control; use environment variables
  • USE --format json when parsing output programmatically
  • SPECIFY federation_version explicitly in supergraph.yaml for reproducibility
  • USE rover subgraph introspect to extract schemas from running services
  • USE rover schema search / rover schema describe (piped from a fetch) to explore large schemas instead of loading the full SDL into context
  • NEVER fetch a full schema into context just to explore it — pipe rover graph fetch/introspect into rover schema describe/search (a bare fetch is only for when the user wants the SDL file itself)

apollographql의 다른 스킬

apollo-client
apollographql
Apollo Client는 로컬 및 원격 데이터를 GraphQL로 관리할 수 있게 해주는 JavaScript용 종합 상태 관리 라이브러리입니다. 버전 4.x는 개선된 캐싱, 더 나은 TypeScript 지원, React 19 호환성을 제공합니다.
official
apollo-client
apollographql
Apollo Client 4.x를 사용하여 React 애플리케이션을 구축하기 위한 종합 가이드로, 쿼리, 뮤테이션, 캐싱 및 상태 관리를 다룹니다. 여러 React 프레임워크 및 설정을 지원합니다: 클라이언트 측 앱(Vite, CRA), React Server Components를 사용하는 Next.js App Router, 스트리밍 SSR을 지원하는 React Router 7, TanStack Start. 쿼리(useQuery, useLazyQuery), 뮤테이션(useMutation)을 위한 훅과 최신 React 18+ 및 19를 위한 Suspense 기반 패턴(useSuspenseQuery, useBackgroundQuery)을 포함합니다.
official
apollo-connectors
apollographql
REST API를 @source 및 @connect 지시문을 사용하여 GraphQL 슈퍼그래프에 통합합니다. 구조화된 5단계 프로세스를 제공합니다: API 구조 조사, 지시문으로 스키마 구현, rover supergraph compose를 통한 검증, 커넥터 실행, 테스트 커버리지. 헤더, 본문 페이로드, N+1 패턴을 위한 배칭, $env를 통한 환경 변수 주입을 포함한 요청 구성을 지원합니다. 필드 선택, 별칭, 중첩 데이터를 위한 하위 선택, 엔티티...를 포함한 응답 매핑을 처리합니다.
official
apollo-federation
apollographql
Apollo Federation은 여러 GraphQL API(서브그래프)를 하나의 통합된 슈퍼그래프로 구성할 수 있게 해줍니다.
official
apollo-ios
apollographql
Apollo iOS는 Apple 플랫폼을 위한 강력한 타입의 GraphQL 클라이언트입니다. GraphQL 작업과 스키마에서 Swift 타입을 생성하며, async/await 클라이언트, 정규화된 캐시(인메모리 또는 SQLite 기반), 쿼리, 뮤테이션 및 멀티파트 구독을 처리하는 플러그형 인터셉터 기반 HTTP 전송, 그리고 모든 작업 유형을 전달할 수 있는 선택적 WebSocket 전송(graphql-transport-ws)을 제공합니다.
official
apollo-kotlin
apollographql
Apollo Kotlin은 GraphQL 연산과 스키마에서 Kotlin 모델을 생성하는 강력한 타입의 GraphQL 클라이언트로, Android, JVM 및 Kotlin Multiplatform 프로젝트에서 사용할 수 있습니다.
official
apollo-mcp-server
apollographql
AI 에이전트를 GraphQL API에 연결하여 Model Context Protocol을 통해 내장된 인트로스펙션 및 작업 도구를 제공합니다. GraphQL 작업을 MCP 도구로 노출하며, 로컬 파일, GraphOS Studio 컬렉션, 지속적 쿼리 매니페스트의 세 가지 작업 소스를 지원합니다. 스키마 탐색 및 임시 쿼리 테스트를 위한 네 가지 인트로스펙션 도구(introspect, search, validate, execute)를 제공하며, 축약 표기법을 사용한 미니피케이션 모드로 토큰 사용량을 줄입니다. 정적 헤더를 통한 구성 가능한 인증,...
official
apollo-router
apollographql
Apollo Router는 Apollo Federation 2 슈퍼그래프를 실행하기 위해 Rust로 작성된 고성능 그래프 라우터입니다. 서브그래프 앞에 위치하여 쿼리 계획, 실행 및 응답 구성을 처리합니다.
official