GraphQL Formatter
Format and prettify GraphQL queries, mutations, subscriptions, type definitions, and fragments. Preserves comments.
GraphQL input
Formatted output
query GetUser($id: ID!) { user(id: $id) { id name email posts(first: 10, orderBy: CREATED_AT_DESC) { edges { node { id title...PostDetails } } } } } # Fragment for post details fragment PostDetails on Post { body createdAt author { name } } mutation CreateUser($input: CreateUserInput!) { createUser(input: $input) { user { id name } errors { field message } } } type User { id: ID! name: String! email: String posts: [Post!]! }
Related tools
JSON to GraphQL SchemaCode
Generate GraphQL type definitions from a JSON example object.
SQL FormatterCode
Format and beautify SQL queries with syntax highlighting.
HTML FormatterCode
Format/prettify HTML locally in your browser.
TOML Formatter & ValidatorCode
Format, validate, and prettify TOML documents locally in your browser.
JSON Formatter & ValidatorJSON
Format, validate, and prettify JSON in your browser. Fast and free.
JSON Sort KeysJSON
Recursively sort JSON object keys for stable diffs.