Skip to main content
>_devtools

GraphQL Formatter

Format GraphQL queries, mutations, fragments and schema (SDL) with Prettier. Syntax errors show line and column.

How to use it

Format GraphQL queries, mutations, fragments and schema (SDL) with Prettier. Syntax errors show line and column. Paste or edit GraphQL SDL or an executable document above; the formatted result updates as you type.

Example

Input: query Search($id:ID!){user(id:$id){name}}
Output:
query Search($id: ID!) {
  user(id: $id) {
    name
  }
}

Limits and behavior

  • The formatter parses GraphQL syntax but does not validate a query against a schema.
  • Input is limited to 1 MiB of UTF-8 text.