GraphQL to XML Converter
Paste a GraphQL schema or query. Get clean XML back.
Input
Output
Paste your GraphQL on the left and press Convert.
Or drop a file on this box, , or .
What this tool does
Sooner or later a GraphQL team gets asked for "the XML version": a partner that only consumes SOAP, an enterprise doc portal built around XSDs, an integration bus that predates JSON. GraphQL types do not map onto XML one to one, so writing it by hand involves guesswork. Paste a few type definitions, a whole SDL file, or a query with its arguments, and you get XML that follows the shape of the data those types describe.
The conversion follows the GraphQL spec's type system. Built-in scalars (String, ID, Int, Float, Boolean) become text, and when there is only a schema and no data, a field's element carries its type name or an empty default so you can see what belongs there. The ! and [ ] markers do not appear in the XML. A list field such as items: [OrderItem!]! still gets its own <items> wrapper, and a nullable field like shippingAddress: Address keeps its element even without a value.
Beyond the built-ins, the tool handles the rest of the type system too. input types turn into nested elements, enum values come through as string text, interface and union types resolve to their underlying concrete shapes, and fragments (named or inline) are pulled in so the output is flat and self-contained. Custom scalars like DateTime, Date, and JSON are emitted as ISO-8601 or stringified values. If you paste a query with arguments, the arguments are preserved as part of the top-level element so the XML is a faithful record of the request, not just a blob of data.
How to use it
Paste SDL or a query, press Convert, copy the XML. A single type and a full schema with operations take the same three steps.
Paste your GraphQL (or try the sample)
Paste GraphQL into the left editor: one type, a full SDL file with inputs, enums, interfaces and unions, or an operation with variables. Load Sample combines three types with a GetOrder($orderId: ID!) query, so the output reflects only the fields that query selects.
You do not need to strip comments or reformat the SDL syntax. Leave it the way your editor wrote it: triple-quoted docstrings and hash comments are both fine.
Hit Convert
Press the green Convert button. The SDL or query is sent to the backend; nothing is executed against a real GraphQL server. Fragments get expanded, the selection set is followed field by field, and the XML is sent back. Until then the editors are dimmed under a "Converting..." overlay.
Copy the XML
The result lands in the read-only right pane, starting with an XML declaration and indented by two spaces, so any XML parser can read it. It makes a good starting point for an XSD example, a SOAP bridge test or the XML section of your API docs.
When this actually comes in handy
XML-based docs for a GraphQL API
Internal docs or partner documentation that lives in XML (DITA, DocBook, XSD-backed reference). Paste the schema, get example XML payloads that match the real types, no hand-translation.
Generating XML fixtures from a schema
Contract tests, snapshot tests, or a mock server that speaks XML. Feed it the schema you already have and get consistent fixture XML with every list, nullable, and nested type in the right place.
Bridging to legacy SOAP clients
A partner system only accepts XML payloads but your backend speaks GraphQL. Paste the query and response type and get a starting-point XML body to drop into the SOAP request.
Schema migration & analysis
Moving off GraphQL onto an XML-based API (or just comparing the two shapes). Get a side-by-side XML version of every type so reviewers who do not read SDL can follow along.
Common questions
How are type, input, enum, interface, and union handled?
type and input become element containers with one child per field. enum values come through as plain string text (the enum name, uppercase, exactly as declared in the SDL). interface resolves to its fields plus any implementing type's fields when we know the concrete type. union resolves to the matched member's shape. See the GraphQL type language reference for the full rules.
What defaults are used for String, Int, Float, Boolean, and ID?
String and ID become text content. Int is a plain integer. Float is a decimal number with no trailing zeros. Boolean is the lowercase text true or false. These match the scalar definitions in the GraphQL spec so the output round-trips cleanly through an XML parser.
How are non-null (!) and list ([T]) markers treated?
The ! and list brackets shape the result but are not written into it. A nullable field with nothing to put in it still gets an element, so every Order has the same children. A list such as items: [OrderItem!]! gets an <items> wrapper; with only a schema and no data, that wrapper is often empty, which tells you where the repeated <OrderItem> children go. [[Int]] nests one wrapper inside another.
Are fragments resolved?
Yes. Named fragments (...OrderFields) and inline fragments (... on Order { ... }) are resolved inline so the XML is flat and self-contained. You do not need to paste the fragment definitions separately, if they are in the same block, the tool wires them up. This matches the normal query-execution model, where fragments are spread into the selection set before the response is built.
What about custom scalars like DateTime?
Well-known custom scalars (DateTime, Date, Time, UUID, JSON) are emitted as ISO-8601 text or stringified values by convention: matching what most scalar libraries do. Unknown custom scalars fall back to string text so nothing is silently dropped. If you need a specific format, post-process the XML or rename the scalar.
Can I paste a query with arguments, not just a schema?
Yes. Paste a query with variables and arguments: e.g. query GetOrder($orderId: ID!) { order(id: $orderId) { ... } }, and the arguments come through as attributes on the top-level element. The selected fields dictate which parts of the response shape are serialised, so the XML matches what the query would actually return, not the whole type.
Other tools you may need
With a GraphQL schema or query expressed as XML, these pages help you validate it, convert it onward to JSON, or format it: