格式化与代码
GraphQL SDL ⇄ TypeScript 类型
Walk a schema, emit typed interfaces — and back again.
Runs in your browser
GraphQL SDL · source
lines: 18chars: 202size: 202 B
TypeScript interfaces · result
lines: 18chars: 241size: 241 B
live
编辑注
Understanding · The schema is the contract, TypeScript is the safety net.
本深度章节目前仅有英文版本。上方的转换工具支持您的语言;长篇说明文章尚未翻译。
常见问题
Quick answers.
›Does this tool support custom scalars?
Yes. When converting SDL to TypeScript, custom scalars are mapped to `any` or `unknown` by default, which you can then refine in your code.
›Are nullable fields handled correctly?
Yes. GraphQL fields without an exclamation mark are converted to optional properties (using the `?` operator) or union types with `null` in TypeScript.
›Can it convert TypeScript back to SDL?
Yes. The tool parses TypeScript interfaces and type aliases to generate a matching GraphQL SDL schema, including support for basic nested objects.
›Is my schema data sent to a backend?
No. The conversion logic runs entirely within your browser session using local parsing libraries, so your schema definitions never leave your device.
大家也在搜索
相关工具
More in this room.
- OpenAPI / Swagger 验证器根据规范规则验证 OpenAPI 3 规范。
- OpenAPI 3.1 YAML ⇄ JSON在 YAML 和 JSON 之间转换 OpenAPI 规范。
- OpenAPI → TypeScript Axios 客户端从任何 OpenAPI 规范生成类型化的 Axios 客户端。
- OpenAPI → React Query Hooks为每个端点自动生成 useQuery + useMutation hook。
- OpenAPI → Postman Collection从任何 OpenAPI 规范生成 Postman v2.1 collection。
- JSON Schema → Zod / Valibot / ArkType从一个 JSON Schema 中生成三种运行时验证器。