Skip to content

GraphQL Formatter

Format, validate and minify GraphQL queries, mutations and schemas with syntax errors pinpointed. Runs on your device.

No uploads
query GetUser($id: ID!, $first: Int = 10) {
  user(id: $id) {
    id
    name
    ...Avatar
    posts(first: $first) {
      edges {
        node {
          id
          title
          createdAt
        }
      }
    }
  }
}

fragment Avatar on User {
  avatar(size: 64) {
    url
  }
}

✓ Valid GraphQL · 1 operation, 1 fragment

How to use GraphQL Formatter

  1. 1Open GraphQL Formatter. It runs in your browser, no sign-up.
  2. 2Type or paste your input.
  3. 3Copy or download the result.

Questions

Does it validate against my schema?

It checks syntax only (queries, mutations, fragments and SDL schemas). No schema or endpoint is needed.

Is anything sent to a server?

No. Formatting uses the reference graphql-js parser in your browser.

What does minify do?

It strips whitespace, commas and comments that GraphQL ignores, keeping the query identical in meaning.

More tools