GraphQL Prettifier
What is a GraphQL Prettifier?
Prettify, format, and minify GraphQL queries, mutations, subscriptions, and Schema Definition Language (SDL) schemas into clean, standardized code.
Why Use This Tool?
- GraphQL API Debugging: Format messy inline GraphQL queries from network request logs or cURL outputs.
- Schema Cleanup: Format GraphQL `.graphql` SDL schema files with clean 2-space indentation.
- Query Minification: Compress GraphQL query strings for production POST request payloads.
How to Use
- Paste unformatted GraphQL query or schema.
- Click "Prettify GraphQL" or "Minify GraphQL".
- Copy formatted output.
Real Working Example
Input:
Unformatted Query: query GetUser($id:ID!){user(id:$id){id name email}}
Output Result:
Formatted Query:
query GetUser($id: ID!) {
user(id: $id) {
id
name
email
}
}
Important Technical Details & Specifications
- GraphQL AST Parser: Uses official `graphql` JS AST parser and printer for syntax-valid formatting.
- Minify Mode: Strips comments and structural whitespace for compact HTTP POST request bodies.
- Local Memory Execution: Zero network overhead.
Related Developer Tools
- JSON Formatter: Prettify and format JSON.
- API Request Tester: Test REST and GraphQL endpoints.
- SQL Formatter: Format SQL queries.
Frequently Asked Questions
Can it format both GraphQL queries and schemas (SDL)?
Yes, queries, mutations, subscriptions, and SDL schema definitions are all supported.
Does it validate GraphQL syntax errors?
Yes, unclosed braces or syntax errors are highlighted with exact line numbers.
Is it free?
Yes, 100% free.
Are my GraphQL queries sent to a server?
No, all formatting runs 100% locally in your web browser.
What is the main function of GraphQL Prettifier?
Prettify, format, and minify GraphQL queries, mutations, and SDL schemas in your browser. This tool processes graphql prettifier data 100% locally inside your web browser.