QCSunny Lab

GraphQL Query & Schema FormatterGraphQL 查询与 Schema 格式化工具

Statistics统计数据
Output转换输出

Pretty-print GraphQL queries, mutations and schemas: the parser understands the GraphQL syntax (fields, arguments, variables, fragments, directives, type definitions) and re-emits them with consistent indentation.

Unlike a JSON formatter, GraphQL is not nested braces — its layout conventions (inline arguments, named fragments, block strings) need a grammar-aware printer, which is what this runs.

Frequently asked questions

Does it validate the query?

It parses, so syntax errors are caught and reported at their position; semantic validation (does the field exist on that type) needs the schema, which stays on your server.

Will reformatting change my query?

No — only whitespace and line breaks. The printed query is semantically identical to the pasted one, character for character where it matters.

中文说明

美化 GraphQL 查询、变更与 schema:解析器理解 GraphQL 语法(字段、参数、变量、片段、指令、类型定义),按一致的缩进重新输出。

与 JSON 格式化不同,GraphQL 不是嵌套大括号——它的排版惯例(内联参数、命名片段、块字符串)需要感知语法的打印机,本工具运行的就是它。

常见问题

它校验查询吗?

它做解析,语法错误会被捕获并指出位置;语义校验(某类型上是否存在该字段)需要 schema,那留在你的服务器上。

重新排版会改变查询吗?

不会——只改空白与换行。输出的查询与粘贴的语义完全一致,关键处逐字符相同。