GraphQL queries and schema definitions use curly braces to nest fields and types, which makes them just as hard to read when compressed onto one line as minified CSS or JSON. This formatter walks through the input and places each field, brace, and statement on its own line, indenting nested selection sets two spaces deeper for every level of brace depth. It's a lightweight, brace-driven beautifier rather than a full GraphQL parser, so it works well on typical queries and schema definitions without needing a GraphQL grammar behind it.
No — it reformats based on braces and statement boundaries, not a GraphQL schema, so it won't catch an unknown field or a type mismatch. Use your GraphQL client or server's validation for that.
Since it formats based on braces rather than the "query" keyword specifically, it works the same way on mutations, subscriptions, fragments, and type/schema definition language (SDL) files.
Arguments in parentheses, like (id: 1), stay on the same line as the field they belong to since indentation is driven by curly braces rather than parentheses — only the field's nested selection set gets its own indented block.