ToolZoneX
Blog

GraphQL Schema to Flow Converter

Paste a GraphQL SDL schema to instantly generate matching Flow exact object types, with nullability mapped onto Flow's maybe-type syntax. Free online developer tool.

Paste GraphQL Schema (SDL)
Flow Types
Flow output will appear here...

Free GraphQL Schema to Flow Converter

Paste a GraphQL SDL schema to instantly generate matching Flow exact object types, with GraphQL's nullability rules mapped onto Flow's ?Type maybe-type syntax.

How to Use It

Paste your GraphQL schema definition language (SDL) into the input box, or click "Load Example" to see a sample run. The tool builds a real schema with GraphQL.js, then walks every object, interface, and input type into a Flow exact object type ({| ... |}), and every enum into a union of string literals. Scalars map onto their closest Flow equivalent, list types becomeArray<T>, and nullable fields (anything not wrapped in GraphQL's !marker) are marked with Flow's ?Type syntax.

Example

A User type with id: ID!, email: String, and posts: [Post!]! generates id: string,, email?: ?string,, and posts: Array<Post>, inside a type User = {| ... |}; declaration.

Common Use Cases

  • Bootstrapping Flow types for a GraphQL API client in a Flow-typed codebase.
  • Comparing how the same schema reads in Flow versus TypeScript syntax.
  • Reviewing a schema's shape without setting up a full Flow codegen pipeline.
  • Speeding up manual Flow type authoring for projects already using GraphQL SDL.

FAQs

Why are the generated object types "exact" ({| |})?

Exact object types ({| ... |}) reject extra properties that aren't declared, which matches how a GraphQL response is shaped — it only ever contains the fields your query selected, so an exact type is the more accurate default.

How are custom scalars handled?

Any scalar beyond the five built-ins (String, Int, Float,Boolean, ID) maps to Flow's any, with a comment listing every custom scalar encountered so you can refine it by hand.

Is my schema uploaded anywhere?

No — parsing and type generation happen entirely client-side in your browser. Nothing you paste is sent to a server.