GraphQL Formatter & Compressor
Online GraphQL formatter and minifier for Query/Mutation/Subscription with one-click beautify and compression
The result will appear here...
GraphQL Formatter & Compressor Guide
Steps
- Paste a GraphQL Query, Mutation, or Subscription on the left.
- Click “Format” to beautify indentation and structure.
- Click “Minify” to generate a compact output for transport or diff.
- Click “Copy” to copy the result to your clipboard.
- Click “Clear” to reset both input and output.
Key features
- Beautify formatting with consistent indentation and line breaks.
- Syntax highlighting for fields, arguments and keywords.
- Minify output by removing redundant whitespace and comments.
- Client-side processing only, nothing is uploaded to a server.
- Works with Query, Mutation and Subscription operations.
What is GraphQL?
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. It lets clients request exactly what they need, reduces over-fetching, and fits evolving APIs and complex data graphs.
Basic syntax
Query
query GetUser($id: ID!) {
user(id: $id) {
id
name
email
posts {
title
content
}
}
}Mutation
mutation CreateUser($input: CreateUserInput!) {
createUser(input: $input) {
id
name
email
}
}Subscription
subscription UserUpdated($userId: ID!) {
userUpdated(userId: $userId) {
id
name
email
}
}