GraphQL Query Formatter & Tester
Uses networkFormat GraphQL queries, validate variables safely, convert SDL to TypeScript and execute queries.
What is GraphQL Query Formatter & Tester?
Format GraphQL queries and SDL schemas, validate variables JSON safely without crashes, generate TypeScript interfaces from GraphQL SDL, and optionally execute queries against any CORS-enabled GraphQL endpoint.
How to use GraphQL Query Formatter & Tester
- Step 1
Paste a GraphQL query and variables JSON.
- Step 2
Format the query or switch to SDL → TypeScript mode.
- Step 3
Optionally enter an endpoint URL and headers to run the query.
Features
- Prettier GraphQL formatting
- Safe variables JSON parser with line/col diagnostics
- GraphQL SDL to TypeScript type generator
- Optional network query runner with headers
Example
Input
query GetUser($id:ID!){user(id:$id){id name}}Output
query GetUser($id: ID!) {
user(id: $id) {
id
name
}
}Formats GraphQL selections and builds the JSON request payload.
Frequently asked questions
Does formatting send my query to a server?
No. Formatting and SDL-to-TypeScript run strictly in your browser.
When does it use the network?
Only when you explicitly click Run Query against a target GraphQL endpoint.
Can it convert GraphQL SDL to TypeScript?
Yes, switch to the SDL → TypeScript tab.
Are invalid variables JSON handled safely?
Yes, errors display cleanly in the Problems panel.
Related tools
API Playground
Send HTTP requests with headers, body, auth, environment variables, collections and cURL import.
cURL to Code Converter
Convert cURL commands to fetch, Axios, Python, Go, Kotlin, Swift, Rust, C# and back.
JSON to TypeScript Converter
Generate TypeScript interfaces, types, Zod schemas, Kotlin, Swift, Dart and Go models.