Swelıty
Tools for everyone

Free Online GraphQL Playground

Write a GraphQL schema, some sample data and a query, and see the result. A safe place to learn GraphQL and try queries with no server.

Auto-run is on, so the result updates as you type. The query runs against the Schema tab, using the JSON in the Data tab as the values for the root fields.

Preview

How to use

  1. Describe your data in the Schema tab, with a Query type as the starting point.

  2. Add sample values in the Data tab as JSON. Each top-level key is the value of a field on Query.

  3. Write a query in the Query tab and see the JSON result update.

  4. Change the query to ask for different fields, or add a field to the schema and the data.

  5. Copy the code, download a zip of your files or clear the editor with the icons above it.

  6. Open the full screen editor for more room, and use the A buttons to resize the text.

  7. Press Format to tidy the tab you are editing, or untick Wrap long lines to scroll sideways instead.

Why use this tool

  • A real GraphQL engine

    The reference implementation validates your query against your schema and runs it, so errors are the ones you would see from a real API.

  • No server needed

    The Data tab provides the values, so you can try ideas without building an API.

  • Three tabs

    Keep the query, the schema and the data apart, like in a real project.

  • Nothing of yours is run

    The schema and query are read as GraphQL and the data as JSON, so no scripts run.

  • One-click formatting

    Tidy the indentation and spacing of the tab you are editing with one click or Shift + Alt + F.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Learn and try GraphQL without a server. Describe your data with a schema, paste sample data as JSON, write a query, and see exactly what it returns. This online GraphQL playground helps you understand how queries select fields, how nested objects and lists work, whether a query matches its schema, or what shape an API could take. Errors, such as asking for a field that is not in the schema, appear in the result.

Frequently asked questions

From the Data tab. The playground uses it as the root value, so a top-level key such as library fills the library field on Query, and nested objects and lists fill the fields below it.

No. Resolvers are code, and the playground does not run your code. Put the values in the Data tab as JSON instead.

Queries only. Mutations would need resolvers that change data, and subscriptions need a live connection.

No. It works with the schema and data you write here. To call a real API you would need a tool that sends requests to that server.

Yes, the first time. GraphQL is loaded from a public CDN when you open the page.

Yes. Press Format, or Shift + Alt + F while you are typing, to tidy the tab you are editing. If the code has a syntax error it is left unchanged and the problem is shown under the editor.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.