A worked example, rendered from real sample data. Sign in to run the tool on your own input.
"""A person with an account."""
type User {
id: ID!
name: String!
email: String
"""Use `name` instead."""
fullName: String @deprecated(reason: "Renamed to name")
posts(first: Int = 10, after: String): [Post!]!
}
type Post {
id: ID!
title: String!
body: String
author: User!
status: PostStatus!
}
enum PostStatus {
DRAFT
PUBLISHED
ARCHIVED
}
type Query {
user(id: ID!): User
posts(status: PostStatus, first: Int = 20): [Post!]!
}
type Mutation {
createPost(input: CreatePostInput!): Post!
}
input CreatePostInput {
title: String!
body: String
authorId: ID!
}━━━ Report ━━━
═══ Schema ═══
Source: SDL
Types: 6
Fields: 16
Root operations: query → Query, mutation → Mutation
Root fields: 3
Max nesting depth: 6
Deprecated members: 1
═══ Types by kind ═══
INPUT_OBJECT: 1 (CreatePostInput)
OBJECT: 4 (Mutation, Post, Query, User)
ENUM: 1 (PostStatus)
═══ Root fields ═══
• Query.user(id: ID!): User
• Query.posts(status: PostStatus, first: Int): [Post!]!
• Mutation.createPost(input: CreatePostInput!): Post!
═══ Deprecations ═══
⚠ User.fullName — Renamed to name
═══ Notes ═══
ℹ Mutation, Post, Query, User reach a cycle, so a client can request unbounded depth.
━━━ SDL ━━━
"""A person with an account."""
type User {
id: ID!
name: String!
email: String
"""Use `name` instead."""
fullName: String @deprecated(reason: "Renamed to name")
posts(first: Int = 10, after: String): [Post!]!
}
type Post {
id: ID!
title: String!
body: String
author: User!
status: PostStatus!
}
enum PostStatus {
DRAFT
PUBLISHED
ARCHIVED
}
type Query {
user(id: ID!): User
posts(status: PostStatus, first: Int = 20): [Post!]!
}
type Mutation {
createPost(input: CreatePostInput!): Post!
}
input CreatePostInput {
title: String!
body: String
authorId: ID!
}
Browse a GraphQL schema — types, fields, arguments, deprecations and reverse references. Part of the DevTools Surf developer suite. Browse more tools in the API / Config collection.