Skip to Content
Type MappingOverview

Type Mapping Overview

How Protocol Buffer types map to GraphQL types.

Quick Reference

ProtobufGraphQL
messagetype (object) + input
message with squash_unionunion
message with interfaceinterface
enumenum
oneofunion
repeated T[T!]!
optional TT (nullable)

Scalar Type Mapping

ProtobufGraphQL (ts-proto)GraphQL (protobuf-es)
int32, uint32, sint32, fixed32, sfixed32IntInt
int64, uint64, sint64, fixed64, sfixed64StringInt64
float, doubleFloatFloat
stringStringString
boolBooleanBoolean
bytesByteByte
google.protobuf.TimestampDateTimeDateTime

See Scalars for complete mappings and customization.

Nullability Rules

Field TypeGraphQL OutputGraphQL Input
Regular fieldNullableNullable
// Required. commentNon-null (!)Non-null (!)
// Output only. commentIncludedExcluded
// Input only. commentExcludedIncluded
repeated field[T!]![T!]!

See Fields for detailed nullability control.