JSON to GraphQL Type
Convert a sample JSON object into GraphQL SDL object types.
Draft GraphQL SDL from a response shape
GraphQL object types describe a stable contract, while many integrations begin with an example JSON response. This tool parses that response and emits schema definition language for the root and nested objects. Integer values map to Int, decimals to Float, booleans to Boolean, strings to String, and arrays to list types using an example element for inference.
The default sample creates type User with user_id as required Int, name as required String, and active as required Boolean. A nested profile object becomes a Profile type, while an orders array becomes a required list of Order entries. The result is useful for prototyping a schema or documenting the shape of an upstream REST response before writing resolvers.
Why schema review still matters
GraphQL nullability is a contract decision, not something one successful payload can prove. Present non-null values receive required markers, but fields can still be absent or null in other responses. Large JSON integers may also exceed GraphQL Int range and need a custom scalar. Generation runs privately in your browser; confirm names, identifiers, nullability, and scalar choices with domain requirements.
Frequently Asked Questions
Does this generate queries or resolvers?
No. It generates GraphQL SDL object type declarations from the sample response shape.
How are JSON arrays represented?
An array becomes a GraphQL list using the first item to infer its element scalar or object type.
Can the tool know whether a field is truly non-null?
No. Required markers reflect the sample and should be checked against the intended API contract.
Browse the full set of free, private, in-browser tools.