EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
Rover schema commands
Explore and search your graph schema from a local SDL file
schema describe
Overview
The rover schema describe command provides structured descriptions of a GraphQL schema. Read from a local SDL file or pipe from stdin. Start with a full schema overview, then zoom into individual types, fields, directives, and arguments using a schema coordinate.
Usage
1rover schema describe [FILE] [OPTIONS]Pass - as FILE or omit it entirely to read from stdin.
Coordinate (--coord) | What you get |
|---|---|
| (none) | Schema overview |
Type | Type description |
Type.field | Field description and return type |
Type.field(arg:) | Field argument detail |
@directive | Directive definition detail |
@directive(arg:) | Directive argument detail |
Options
| Option | Description |
|---|---|
-c, --coord <SCHEMA_COORDINATE> | Schema coordinate to inspect (e.g. Post, User.posts, @auth) |
-d, --depth <N> | Expand referenced types N levels deep (default: 0) |
--include-deprecated | Show deprecated fields and values |
-v, --view <VIEW> | Output view: description (default) or sdl |
Examples
Schema overview
1rover schema describe schema.graphql1SCHEMA schema.graphql
2
330 types
486 fields
53 deprecated fields
6
7Operations
8+----------+---+-------------------+
9| Type | # | Fields |
10+==================================+
11| Query | 5 | user |
12| | | post |
13| | | categories |
14| | | search |
15| | | viewer |
16|----------+---+-------------------|
17| Mutation | 3 | createPost |
18| | | updatePreferences |
19| | | deleteComment |
20+----------+---+-------------------+
21
22Types
23+------------+----+--------------------------+
24| Kind | # | Names |
25+============================================+
26| objects | 16 | Category |
27| | | Comment |
28| | | CommentConnection |
29| | | CommentEdge |
30| | | CreatePostPayload |
31| | | DeleteCommentPayload |
32| | | PageInfo |
33| | | Post |
34| | | PostConnection |
35| | | PostEdge |
36| | | Preferences |
37| | | SearchResults |
38| | | Tag |
39| | | UpdatePreferencesPayload |
40| | | User |
41| | | Viewer |
42|------------+----+--------------------------|
43| inputs | 2 | CreatePostInput |
44| | | UpdatePreferencesInput |
45|------------+----+--------------------------|
46| enums | 4 | DigestFrequency |
47| | | Role |
48| | | SearchType |
49| | | SortOrder |
50|------------+----+--------------------------|
51| interfaces | 3 | Node |
52| | | Profile |
53| | | Timestamped |
54|------------+----+--------------------------|
55| unions | 1 | ContentItem |
56|------------+----+--------------------------|
57| scalars | 2 | DateTime |
58| | | URL |
59+------------+----+--------------------------+JSON output (--format json)
1{
2 "Overview": {
3 "schema_source": "schema.graphql",
4 "total_types": 30,
5 "total_fields": 86,
6 "total_deprecated": 3,
7 "query_fields": [
8 { "name": "user", "return_type": { "Named": "User" } },
9 { "name": "post", "return_type": { "Named": "Post" } },
10 { "name": "categories", "return_type": { "NonNullList": { "NonNullNamed": "Category" } } },
11 { "name": "search", "return_type": { "Named": "SearchResults" } },
12 { "name": "viewer", "return_type": { "Named": "Viewer" } }
13 ],
14 "mutation_fields": [
15 { "name": "createPost", "return_type": { "Named": "CreatePostPayload" } },
16 { "name": "updatePreferences", "return_type": { "Named": "UpdatePreferencesPayload" } },
17 { "name": "deleteComment", "return_type": { "Named": "DeleteCommentPayload" } }
18 ],
19 "objects": ["Category", "Comment", "CommentConnection", "CommentEdge", "CreatePostPayload", "DeleteCommentPayload", "PageInfo", "Post", "PostConnection", "PostEdge", "Preferences", "SearchResults", "Tag", "UpdatePreferencesPayload", "User", "Viewer"],
20 "inputs": ["CreatePostInput", "UpdatePreferencesInput"],
21 "enums": ["DigestFrequency", "Role", "SearchType", "SortOrder"],
22 "interfaces": ["Node", "Profile", "Timestamped"],
23 "unions": ["ContentItem"],
24 "scalars": ["DateTime", "URL"]
25 },
26 "success": true
27}Type description
1rover schema describe schema.graphql --coord User1TYPE User (object)
2
3A registered user
4
5implements Node, Profile
6
78 fields
81 deprecated fields
9
10Fields
11+-----------+----------------+-----------------------------+
12| Field | Type | Description |
13+==========================================================+
14| id | ID | |
15|-----------+----------------+-----------------------------|
16| name | String | |
17|-----------+----------------+-----------------------------|
18| email | String | The user's email address |
19|-----------+----------------+-----------------------------|
20| posts | PostConnection | Posts authored by this user |
21|-----------+----------------+-----------------------------|
22| bio | String | |
23|-----------+----------------+-----------------------------|
24| avatarUrl | String | |
25|-----------+----------------+-----------------------------|
26| createdAt | String | |
27+-----------+----------------+-----------------------------+
28
29Available via: Query.user, Mutation.createPost -> CreatePostPayload.post -> Post.authorJSON output (--format json)
1{
2 "Type": {
3 "type": "object",
4 "name": "User",
5 "description": "A registered user",
6 "implements": ["Node", "Profile"],
7 "fields": [
8 { "name": "id", "return_type": "ID", "description": null, "is_deprecated": false, "deprecation_reason": null, "arg_count": 0 },
9 { "name": "name", "return_type": "String", "description": null, "is_deprecated": false, "deprecation_reason": null, "arg_count": 0 },
10 { "name": "email", "return_type": "String", "description": "The user's email address", "is_deprecated": false, "deprecation_reason": null, "arg_count": 0 },
11 { "name": "posts", "return_type": "PostConnection", "description": "Posts authored by this user", "is_deprecated": false, "deprecation_reason": null, "arg_count": 2 },
12 { "name": "bio", "return_type": "String", "description": null, "is_deprecated": false, "deprecation_reason": null, "arg_count": 0 },
13 { "name": "avatarUrl", "return_type": "String", "description": null, "is_deprecated": false, "deprecation_reason": null, "arg_count": 0 },
14 { "name": "createdAt", "return_type": "String", "description": null, "is_deprecated": false, "deprecation_reason": null, "arg_count": 0 }
15 ],
16 "field_count": 8,
17 "deprecated_count": 1,
18 "expanded_types": [],
19 "via": [
20 { "segments": [{ "type_name": "Query", "field_name": "user" }] },
21 { "segments": [{ "type_name": "Mutation", "field_name": "createPost" }, { "type_name": "CreatePostPayload", "field_name": "post" }, { "type_name": "Post", "field_name": "author" }] }
22 ]
23 },
24 "success": true
25}Field description
1rover schema describe schema.graphql --coord User.posts1FIELD User.posts: PostConnection
2
3Posts authored by this user
4
52 args
6Args
7+--------+------+-------------------------------------------------+
8| Arg | Type | Notes |
9+=================================================================+
10| limit | Int | Maximum number of posts to return (default: 20) |
11|--------+------+-------------------------------------------------|
12| offset | Int | |
13+--------+------+-------------------------------------------------+
14
15Available via: Query.user, Mutation.createPost -> CreatePostPayload.post -> Post.author
16
17Return type: PostConnection (object)
18+----------+----------+
19| Field | Type |
20+=====================+
21| edges | PostEdge |
22|----------+----------|
23| pageInfo | PageInfo |
24+----------+----------+JSON output (--format json)
1{
2 "Field": {
3 "type_name": "User",
4 "field_name": "posts",
5 "return_type": { "Named": "PostConnection" },
6 "description": "Posts authored by this user",
7 "arg_count": 2,
8 "args": [
9 { "name": "limit", "arg_type": "Int", "description": "Maximum number of posts to return", "default_value": "20" },
10 { "name": "offset", "arg_type": "Int", "description": null, "default_value": null }
11 ],
12 "via": [
13 { "segments": [{ "type_name": "Query", "field_name": "user" }] },
14 { "segments": [{ "type_name": "Mutation", "field_name": "createPost" }, { "type_name": "CreatePostPayload", "field_name": "post" }, { "type_name": "Post", "field_name": "author" }] }
15 ],
16 "input_expansions": [],
17 "return_expansion": {
18 "kind": "object",
19 "name": "PostConnection",
20 "fields": [
21 { "name": "edges", "return_type": "PostEdge", "description": null, "is_deprecated": false, "deprecation_reason": null, "arg_count": 0 },
22 { "name": "pageInfo", "return_type": "PageInfo", "description": null, "is_deprecated": false, "deprecation_reason": null, "arg_count": 0 }
23 ],
24 "implements": [],
25 "implementors": []
26 },
27 "is_deprecated": false,
28 "deprecation_reason": null
29 },
30 "success": true
31}Field argument detail
1rover schema describe schema.graphql --coord "User.posts(limit:)"1FIELD ARG User.posts(limit:): Int
2
3Maximum number of posts to return
4
5Default: 20JSON output (--format json)
1{
2 "FieldArg": {
3 "type_name": "User",
4 "field_name": "posts",
5 "arg_name": "limit",
6 "arg_type": { "Named": "Int" },
7 "description": "Maximum number of posts to return",
8 "default_value": "20"
9 },
10 "success": true
11}Directive description
1rover schema describe schema.graphql --coord "@auth"1DIRECTIVE @auth
2
3Marks a field or object as requiring a minimum role
4
5Locations: FIELD_DEFINITION, OBJECT
6
7Args
8+----------+------+----------------------------------------------------------------+
9| Arg | Type | Notes |
10+==================================================================================+
11| requires | Role | The minimum role required to access this field (default: USER) |
12+----------+------+----------------------------------------------------------------+JSON output (--format json)
1{
2 "Directive": {
3 "name": "auth",
4 "description": "Marks a field or object as requiring a minimum role",
5 "args": [
6 {
7 "name": "requires",
8 "arg_type": "Role",
9 "description": "The minimum role required to access this field",
10 "default_value": "USER"
11 }
12 ],
13 "locations": ["FIELD_DEFINITION", "OBJECT"],
14 "repeatable": false
15 },
16 "success": true
17}Directive argument detail
1rover schema describe schema.graphql --coord "@auth(requires:)"1DIRECTIVE ARG @auth(requires:): Role
2
3The minimum role required to access this field
4
5Default: USERJSON output (--format json)
1{
2 "DirectiveArg": {
3 "directive_name": "auth",
4 "arg_name": "requires",
5 "arg_type": "Role",
6 "description": "The minimum role required to access this field",
7 "default_value": "USER"
8 },
9 "success": true
10}SDL view
1rover schema describe schema.graphql --coord User --view sdlReturns the raw SDL for the requested type or directive definition.
Read from stdin
1cat schema.graphql | rover schema describe --coord Post
2rover schema describe - --coord Postschema search
Overview
The rover schema search command searches a GraphQL schema for types and fields by keyword and can read from a local SDL file or pipe from stdin. Rover ranks results by match strength — exact name matches first, then stem matches, then fuzzy matches, then description-only matches — up to a configurable limit.
Usage
1rover schema search [FILE] [TERMS...] [OPTIONS]Pass the SDL file as FILE followed by one or more search terms. Pass - as FILE to read from stdin.
Query syntax
Single terms. A single keyword searches all name tokens and SDL descriptions:
email— matchesUser.email,EmailPreferences,sendEmailpost— matchesPost,createPost,PostConnection,post_id
AND logic. Space-separate multiple terms to require all of them to match:
"create post"— matchesCreatePostInputandMutation.createPost, but notPostalone (missingcreate)"user email"— only returns results where bothuserandemailmatch the same coordinate
OR clauses. Comma-separate independent queries to return results matching any clause:
"email, creating"— returns everything matchingemailplus everything matchingcreating"create post, delete comment"— each clause can itself be multi-term
Name tokenization. Rover splits names on camelCase and snake_case boundaries before matching, so a term can match any token in the name. Matching is case-insensitive:
postmatchescreatePost(tokenpost),PostConnection(tokenPost), andpost_id(tokenpost)creatematchesCreatePostInput,Mutation.createPost, andcreatePost
Match tiers. Results are ranked strongest-first within each clause:
| Tier | Example query | Matches | Why |
|---|---|---|---|
| Exact | email | User.email | email is a name token |
| Stem | creating | CreatePostInput, Mutation.createPost | creating and create share the stem creat |
| Fuzzy | emial | User.email | one transposition from email (terms ≥ 4 chars only) |
| Description | membership | Role | membership appears in the SDL description of Role, not in its name |
Options
| Option | Description |
|---|---|
-n, --limit <N> | Maximum number of results to return (default: 10) |
--include-deprecated | Include deprecated fields and enum values in results |
Examples
All examples on this page use the following schema:
schema.graphql
1"""Root query type"""
2type Query {
3 """Get a user by ID"""
4 user(id: ID!): User
5 """Get a post by ID"""
6 post(id: ID!): Post
7}
8
9type Mutation {
10 """Create a new post"""
11 createPost(input: CreatePostInput!): Post
12}
13
14"""A registered user"""
15type User implements Node {
16 id: ID!
17 """The user's email address"""
18 email: String!
19 displayName: String!
20 """Posts authored by this user"""
21 posts: [Post!]!
22 legacyId: String @deprecated(reason: "Use id instead")
23}
24
25"""A content post"""
26type Post implements Node {
27 id: ID!
28 title: String!
29 """The author of this post"""
30 author: User!
31 body: String!
32}
33
34"""An entity with a stable ID"""
35interface Node {
36 id: ID!
37}
38
39"""Membership tier governing access"""
40enum Role {
41 ADMIN
42 USER
43 GUEST @deprecated(reason: "Use USER instead")
44}
45
46input CreatePostInput {
47 """The post title"""
48 title: String!
49 body: String!
50}Basic search
1rover schema search schema.graphql email11 result for "email"
2
3User.email — The user's email address
4 field · via Query.user, Mutation.createPost -> Post.authorJSON output (--format json)
1{
2 "json_version": "1",
3 "data": {
4 "query": "email",
5 "results": [
6 {
7 "coordinate": "User.email",
8 "kind": "field",
9 "description": "The user's email address",
10 "via": [
11 {
12 "segments": [
13 { "type_name": "Query", "field_name": "user" }
14 ]
15 },
16 {
17 "segments": [
18 { "type_name": "Mutation", "field_name": "createPost" },
19 { "type_name": "Post", "field_name": "author" }
20 ]
21 }
22 ]
23 }
24 ],
25 "success": true
26 },
27 "error": null
28}Multi-term AND search
All terms must match.
1rover schema search schema.graphql "create post"12 results for "create post"
2
3CreatePostInput
4 type
5
6Mutation.createPost — Create a new post
7 fieldOR clauses (comma-separated)
Separate independent queries with commas. A result is included if any clause matches.
1rover schema search schema.graphql "email, creating"13 results for "email, creating"
2
3User.email — The user's email address
4 field · via Query.user, Mutation.createPost -> Post.author
5
6CreatePostInput
7 type
8
9Mutation.createPost — Create a new post
10 fieldStem match
Terms match names that share an English stem. Searching creating finds names containing create, creates, and created.
1rover schema search schema.graphql creating12 results for "creating"
2
3CreatePostInput
4 type
5
6Mutation.createPost — Create a new post
7 fieldDescription-only match
If a term appears only in an SDL description and not in any name, the result is still included (ranked last).
1rover schema search schema.graphql membership11 result for "membership"
2
3Role — Membership tier governing access
4 typeInclude deprecated
Rover excludes deprecated fields and enum values by default. Pass --include-deprecated to surface them.
1rover schema search schema.graphql guest --include-deprecated11 result for "guest"
2
3Role.GUEST
4 enum valueLimit results
Limit the number of results with -n.
1rover schema search schema.graphql post -n 212 results for "post"
2
3CreatePostInput
4 type
5
6Mutation.createPost — Create a new post
7 fieldNo results
When no types or fields match, Rover prints a message instead of an empty list.
1rover schema search schema.graphql xyzzy1No results for "xyzzy"Read from stdin
Pass - as FILE to read the schema from stdin instead of a file.
1cat schema.graphql | rover schema search - email
2rover schema search - email < schema.graphql