GraphQL Viewer
Read a schema as one table per type, or a query as the tree of fields it asks for
Schema or query
View
What the GraphQL Viewer shows you
A schema file answers questions like "what does Order.items take as arguments?" or "which fields on Customer can be null?", but in raw schema definition language the answer is buried in a long run of braces. This page reads the SDL and turns every definition into its own collapsible block: object types, interfaces, inputs, enums, unions, scalars, the schema root and directive definitions. Each block holds a table with one row per field, showing the name, the full type with its ! and [ ] modifiers, the arguments, any default value and the description.
Paste an operation instead and you get a tree. A query, mutation, subscription or fragment opens as nested rows, one per selected field, with aliases shown as lines: items, arguments in brackets, fragment spreads as ...Totals and inline fragments as ... on DigitalOrder. The reading follows the grammar of the October 2021 GraphQL specification, so block-string descriptions lose their indentation the way a server would strip it, and a schema mixed with operations in one file shows both.
Type names in the Type column are links when the definition is in the same document: click OrderItem in the Order table and the view scrolls to OrderItem and opens it. The filter box narrows the list to types and fields whose names contain what you type. Nothing is sent anywhere; the reading happens in the page.
How to Use the GraphQL Viewer
Nothing needs pressing: about 300 ms after your last keystroke the tables and trees on the right are rebuilt.
Load a schema or an operation
Paste into the left pane, use Upload for a .graphql, .graphqls, .gql or .txt file, or press Sample for a storefront schema with an Order, a Node interface, an OrderFilter input and a Query root. To see the tree view, replace it with an operation such as this one:
query OrderSummary($id: ID!, $first: Int = 5) {
order(id: $id) {
id
...Totals
lines: items(first: $first) { sku quantity }
}
}
fragment Totals on Order { total { amountCents currency } } That query shows up as two blocks: OrderSummary with a variables table ($id of type ID!, $first of type Int defaulting to 5) and a tree where lines: items(first: $first) holds sku and quantity, then the Totals fragment on Order. Schemas written for Apollo Server, including federation directives like @key(fields: "id"), are listed with their directives next to the type or field.
Find what you came for
Use the filter box to cut a 200-type supergraph down to the few types that mention invoice, or press Collapse all and open only the blocks you need. Descriptions written as """...""" above a type or field appear in its row, which is where the GraphQL specification expects documentation to live. A missing : or an unclosed brace gives a message with the line and column, and the line is flagged in the editor.
Make room to read
Maximize gives the view the whole window (Escape brings the editor back), and the bar between the panes can be dragged to give either side more width. Clear empties the left pane for the next file.
Where a type-by-type view helps
Checking a schema change before you review it
Before reading a schema PR line by line, paste the new file here and open the types it touches. Seeing status: OrderStatus! turn into status: OrderStatus in a table is easier than spotting one missing character in a diff, and it is the kind of nullability change that GraphQL best practices warn about.
Reading a composed supergraph
A gateway hands back one long SDL file with every subgraph merged in. Filter by the type you are debugging, check which directives sit on it, and use the type links to follow a field across three or four types without losing your place.
Working out what a query asks for
A query copied from a network tab or a client repo can run to a hundred lines with fragments spread through it. The tree view shows the shape at a glance, aliases included, and collapsing a branch hides the parts you have already checked.
Showing a new teammate the API
Walk someone through the schema with the tables open on a shared screen. The arguments and defaults column answers most "what do I pass here" questions before they reach for the docs.
Common Questions
Does the viewer check that my schema is valid?
It checks the syntax, not the meaning. A missing colon, a stray brace or an unterminated string stops the view with the line and column. A field that points at a type nobody defined, or a schema with no Query type, displays without complaint; the type name simply is not a link. buildSchema in graphql-js or your server's startup is where those are caught.
Can I paste a query and a schema together?
Yes. The page reads both kinds of definition in one document. Types are listed first, then operations and fragments in the order they appear. A ...Totals spread links to the Totals fragment when it is in the same document.
How are list and non-null types shown?
Exactly as written. [OrderItem!]! means the list itself is never null and no item in it is null, while [OrderItem] allows both. The viewer keeps the brackets and exclamation marks in the Type column instead of translating them, so what you read matches the SDL.
What happens to extend blocks and directives?
An extend type Query { ... } gets its own block labelled extend, next to the original definition, so you can see which fields each file adds. Directives such as @deprecated(reason: "...") appear in the description column of the field or enum value they sit on, and directive definitions get a block listing their arguments and allowed locations.
Is there a size limit?
Documents over 2 MB are refused, because laying out tables for that many fields freezes the tab. A supergraph of a few hundred types is well under that and stays responsive; collapse the blocks you are not reading if scrolling gets slow.
Other GraphQL Tools
To change the SDL rather than read it, or to view the JSON a GraphQL server sends back, these pages do that job: