developers.do

GraphQL Formatter

Format and validate GraphQL queries, mutations, subscriptions, and fragments — preserves string literals and handles args, blocks, lists, comments, and descriptions

✓ Valid
query GetUser(
  $id: ID!
)
{
  user(
    id: $id
  )
  {
    id name email posts{
      title createdAt
    }
  }
}
Note: This is a fast formatting pass using a regex-driven walker — not a full spec-compliant GraphQL parser. It preserves string literals and structural tokens but may not match prettier-plugin-graphql output for every stylistic edge case (e.g. inline vs. multi-line args).