How to use the GraphQL Query Builder
- Open Schema (SDL) and paste your schema, or use the sample.
- Choose Query, Mutation or Subscription.
- Tick fields in the tree; expand objects to pick nested fields and fill in arguments.
- Copy the generated query, the variables JSON or the ready-made
fetch()call.
How the builder works
The schema is parsed with graphql-js and turned into a tree that starts at the root type of the operation you choose. Ticking a field adds it to the selection; ticking an object field expands it so you can choose its sub-fields. Arguments you fill in become variables with the right GraphQL types ($id: ID!), so the query stays reusable and safe from injection, and the variables JSON is generated next to it.
Tips
- Fields typed as interfaces or unions show their implementations as inline fragments (
... on Book). - Required arguments are marked with
!; leave optional ones empty to omit them. - Use the filter box to find a field in large schemas.
Format or check an existing query with the GraphQL formatter & validator, and inspect the JSON response in the JSON viewer.
Tools that pair well with the GraphQL Query Builder
- cURL to Code — Paste a curl command — from API docs or “Copy as cURL” in your browser’s DevTools — and get ready-to-run code for six languages, with headers, body and authentication carried over.
- OpenAPI / Swagger Validator — Paste an API specification to check it against the official OpenAPI schema, catch broken references and inconsistent path parameters, and see every endpoint at a glance.
- JSON to Types — Paste an API response and get ready-to-use models in 8 languages: TypeScript, Python (dataclass, TypedDict or Pydantic), Go, Java, C#, Kotlin, Swift and Rust.
- JSON Schema Validator — Paste a schema and some JSON to see exactly which values break which rule — or generate a starting schema from example data.
Frequently asked questions
Where do I get my schema SDL?
/graphql/schema or in the repository (schema.graphql). You can also export it with rover graph introspect or npx get-graphql-schema https://api.example.com/graphql.