Prettify & Minify GraphQL Queries
Format, clean, and indent GraphQL queries, mutations, and fragments, or minify into single-line POST bodies.
About This Tool
GraphQL Query Prettifier formats unreadable or minified GraphQL queries with clean indentation, and compresses multi-line queries into single-line strings suitable for HTTP POST payloads.
Key Features
GraphQL query and mutation prettifier
Single-line query minification
Query variables JSON editor
One-click copyable formatted output
How to Use This Tool
- Paste your GraphQL query, mutation, or fragment.
- Optionally enter query variables in the JSON editor.
- Click 'Prettify Query' for formatted view or 'Minify for POST Body' for compact output.
Why Use This Tool
- Improves GraphQL code readability in PRs and documentation, and optimizes payload sizes for network transmission.
- Strips comments and formats nested selections automatically.
Pro Tips
- Use GraphQL fragments to reuse common field selections across multiple queries
Frequently Asked Questions
Why should I minify GraphQL queries for production?
Minifying queries removes extra whitespace and comments, reducing HTTP request payload size and saving bandwidth across high-throughput APIs.
Related Tools
API Mock Payload & Fake Data Generator
Generate mock JSON REST API responses for Users, Products, and Paginated datasets.
Linux Chmod Permissions Calculator
Calculate Linux/Unix file permissions visually with octal numbers and symbolic notation.
Cron Expression Descriptor
Convert cron expressions into human-readable text.