Use GraphQL Formatter

Enter your data below to use the GraphQL Formatter

📌 Try these examples:
RESULT

Last updated

Formatting Rules Applied

Examples

Example 1: Formatting a Query

Before (minified / unformatted):

query GetUser($id: ID!) { user(id: $id) { id name email profile { avatar bio location } posts(first: 10) { edges { node { id title createdAt } } } } }

After formatting:

query GetUser($id: ID!) {
  user(id: $id) {
    id
    name
    email
    profile {
      avatar
      bio
      location
    }
    posts(first: 10) {
      edges {
        node {
          id
          title
          createdAt
        }
      }
    }
  }
}

Example 2: Formatting a Mutation

Before:

mutation CreatePost($input: CreatePostInput!) { createPost(input: $input) { id title content author { id name } tags { id name } createdAt } }

After formatting:

mutation CreatePost($input: CreatePostInput!) {
  createPost(input: $input) {
    id
    title
    content
    author {
      id
      name
    }
    tags {
      id
      name
    }
    createdAt
  }
}

Example 3: Formatting with Fragments

Before:

fragment UserFields on User { id name email avatar } query GetUsers { users { ...UserFields posts { id title } } }

After formatting:

fragment UserFields on User {
  id
  name
  email
  avatar
}

query GetUsers {
  users {
    ...UserFields
    posts {
      id
      title
    }
  }
}

Frequently Asked Questions

Simply enter your data, click the process button, and get instant results. All processing happens in your browser for maximum privacy and security.

Yes! GraphQL Formatter is completely free to use with no registration required. All processing is done client-side in your browser.

Absolutely! All processing happens locally in your browser. Your data never leaves your device, ensuring complete privacy and security.