Protobuf to GraphQL Converter
Paste a .proto schema. Get GraphQL SDL with types, enums, non-null lists, and synthetic entry types for map fields: ready to seed a gateway schema.
Input (.proto schema)
Output (GraphQL SDL)
Paste your Protobuf on the left and the GraphQL shows up here.
Or drop a file on this box, , or .
What this tool does
Somewhere in your stack there is a Protocol Buffers contract, and now somebody wants a GraphQL layer on top of it. Runtime bridges such as Google's rejoiner can expose proto messages through a live endpoint, but before anyone writes a resolver the team usually wants to argue about the SDL itself: which fields are nullable, what the list types look like, how maps come across. This page gives you that draft from the .proto text alone, so the argument can start from a real schema.graphql instead of a whiteboard.
Each message becomes a GraphQL type; each enum becomes a GraphQL enum. Field names are converted from snake_case (proto convention) to camelCase (the convention encoded in the GraphQL spec and enforced by every linter). Scalars and enums are emitted as non-null (String!, OrderStatus!) because proto3 fields always have a value on the wire, even unset ones default to the zero value. Singular nested messages are emitted as nullable, which matches proto3 has-value semantics.
Repeated fields render as [T!]!, non-null list of non-null elements, because proto3 repeated fields are never null and never contain null entries. Maps need a workaround: GraphQL has no native map type, so map<string, string> on a metadata field becomes [OrderMetadataEntry!]! with a synthetic type OrderMetadataEntry { key: String! value: String! }, the same pattern used by Apollo and most production proto-to-GraphQL gateways. The whole conversion runs client-side; nothing about your schema leaves the page.
How to use it
Three steps. Output is paste-ready for any GraphQL server that accepts SDL.
Paste your .proto schema
Paste the .proto into the left pane, or pick the file with Upload. The SDL on the right rebuilds a moment after each edit, so you can rename a field and watch the GraphQL type change with it. service and rpc blocks are skipped (there is no query or mutation output), and an import line is ignored rather than followed, which means a type that lives in another file shows up in the SDL under its bare name with no definition. Copy that message into the editor and it gets a real type.
Watch the casing on the way through: a proto field called shipping_address comes out as shippingAddress, while message names and enum values are copied exactly. A map field gets its own entry type, named from the parent message plus the field, so Order.metadata produces OrderMetadataEntry.
Read the output
On the right: GraphQL SDL with enums first, then map-entry types, then messages in declaration order. Nested types come before their parents so the file reads top-down. Drop it into a .graphql file your server loads via graphql-tools or buildSchema.
Wire up resolvers
The schema gives you the shape; you still need to write resolvers (or generate them from your gRPC service). For a quick path, point an Apollo Server at this SDL with stub resolvers, then replace each stub with a call to your gRPC backend. Adjust nullability if your runtime contract differs from proto3 defaults.
When this actually saves time
Bootstrapping a GraphQL gateway over a gRPC backend
Your team has a gRPC service and product wants a GraphQL endpoint for the web client. You need a starting-point schema to discuss with frontend engineers before writing any resolvers. Paste the proto, copy the SDL, drop it in a doc: done.
Reviewing a Protobuf API change
A pull request touches order.proto and you own the public GraphQL contract. Paste the old file, save the SDL, paste the new one and compare the two. A new scalar arriving as non-null, or a field that quietly changed name, is much easier to spot in SDL than in a proto diff, and that is the comment worth leaving on the PR.
Documentation and design discussions
You are writing an RFC about a new gRPC service that will eventually need a GraphQL fronting. Embedding both shapes in the doc (proto on one side, SDL on the other) makes the conversation concrete. This converter gets you the SDL side without standing up a build.
Migrating from REST or gRPC to GraphQL
You inherited a Protobuf-defined service and the new product brief calls for a GraphQL API. Generate a draft schema here as the starting point for the migration, then iterate on field names, nullability, and pagination by hand.
Common questions
Is my schema sent anywhere?
No. Parsing the .proto and writing the SDL both happen in script loaded with the page, and the editor contents are never posted anywhere. That matters for gateway work in particular, because the schema you paste often names internal services and packages that are not public yet.
Why are 64-bit ints typed as String?
GraphQL's built-in Int scalar is signed 32-bit per the GraphQL spec, which cannot hold a proto int64 or uint64. The conventional workaround is to define a custom scalar (often called BigInt, Long, or Int64) and serialise the value as a string. This converter emits String for all 64-bit integer types so the schema is valid out of the box; replace those occurrences with your custom scalar name once you have one defined on the server.
How are map fields handled?
GraphQL has no native map type: there is no { String: String } shape. The standard workaround is to unroll the map into a list of { key, value } pairs. So map<string, string> metadata = 8; on a message Order becomes metadata: [OrderMetadataEntry!]! with a synthetic type OrderMetadataEntry { key: String! value: String! }. The entry type name is derived from the parent message + field name in PascalCase + Entry, which is the convention used by most proto-to-GraphQL gateways including rejoiner.
How is oneof handled?
Plainly. The oneof wrapper is dropped and its members become ordinary fields, but nullable ones, because only one member is ever set. So oneof payment { string card_token = 4; string iban = 5; } comes out as cardToken: String and iban: String, with no comment marking the group. If you want GraphQL to enforce the "exactly one" rule, model the group as a union on output and an @oneOf input object for arguments.
Why are scalars non-null but messages nullable?
This matches proto3 semantics. Scalars in proto3 always have a value on the wire: an unset string field defaults to "", an unset int32 defaults to 0. There is no way to distinguish "set to default" from "unset" for scalars without optional, which is why a proto3 optional scalar comes out nullable here. Singular nested messages, however, do have has-value semantics, the field tag may be entirely missing, so they map naturally to nullable GraphQL fields. Repeated fields are always non-null lists with non-null elements, again matching proto3.
What about google.protobuf.Timestamp and other well-known types?
Well-known types are emitted as String by default, since GraphQL has no built-in DateTime scalar. Most production schemas define a custom DateTime (or ISO8601String) scalar and replace the String occurrences after generation. The same applies to google.protobuf.Duration, Any, and Value: emit as String first, swap in custom scalars once defined.
Bytes fields: why String?
GraphQL has no native binary scalar. The conventional encoding is base64 in a String field, which is also what the proto3 JSON mapping uses for bytes. If you want stricter typing, define a Base64String custom scalar on the server and replace String on those fields.
Related tools
If you are working with Protobuf, GraphQL, and JSON, these pair well: