JSON Formatter
Beautifies or minifies JSON.
Format GraphQL queries, mutations, and schema definitions into clean, consistent code, or minify them for sending. Syntax errors are reported with their line and column.
.graphql file.The input is parsed with graphql-js, the reference implementation of the GraphQL specification, into a syntax tree. That parse is the validation step: anything the specification's grammar doesn't allow is an error.
Input:
query GetUser($id:ID!){user(id:$id){id name posts(first:5){title}}}Beautified:
query GetUser($id: ID!) {
user(id: $id) {
id
name
posts(first: 5) {
title
}
}
}A missing closing brace, as in { user { id }, gives: Syntax Error: Expected Name, found <EOF>, at the end of the input.
No. It checks that the query is valid GraphQL syntax. To check field names and types, run it against your API or use your server's introspection in a GraphQL IDE.
Yes. Type definitions, interfaces, enums, inputs, unions, directives, and schema extensions are all formatted.
Queries are sent in request bodies or URLs. Minifying makes them smaller, which helps with GET requests and persisted queries.
No. It is parsed and printed in your browser.
Often used together with the GraphQL Formatter & Validator.
Beautifies or minifies JSON.
Builds copy-ready cURL commands with headers, auth, and a body, quoted for your shell.
Checks OpenAPI 3.x and Swagger 2.0 specs for structural errors and broken $refs.