What is GraphQL Formatting?
GraphQL formatting makes queries, mutations, and schema definitions readable. Complex nested queries can become hard to follow - proper formatting reveals their structure at a glance.
This formatter handles both GraphQL operations and schema definition language (SDL) using Prettier's GraphQL parser.
What Gets Formatted
The formatter handles:
- Queries with nested fields
- Mutations and subscriptions
- Fragment definitions
- Type definitions and schemas
- Input types and enums
Frequently Asked Questions
What is GraphQL formatting?
GraphQL formatting structures queries, mutations, and schema definitions with consistent indentation and line breaks. It makes complex GraphQL operations readable.
Does formatting change query results?
No, formatting only changes whitespace. Your GraphQL queries will return the same results - only their visual presentation changes.
Can I format GraphQL schema definitions?
Yes! This formatter works with both GraphQL operations (queries, mutations, subscriptions) and schema definitions (types, interfaces, inputs).