QuickDevGuide

Home › GraphQL & gRPC

Protocol Buffers Language Guide — GraphQL & gRPC

gRPC contracts are written in proto3. Each field has a number that identifies it on the wire — names can change, numbers must not. Feature Syntax Scalars int32, int64, uint32, double, float, bool, string, bytes Repeated (list) repeated string tags = 4; Map map<string, int32> stock = 5; Enum first value must be 0 (...UNSPECIFIED) Oneof at most one field set: oneof payment { Card card = 6; string iban = 7; } Optional presence optional string nickname = 8; Well-known types google.protobuf.Timestamp, Duration, Empty, FieldMask, wrappers Nested / imported messages import "common/money.proto"; Backward-compatible evolution ✅ Add new fields with new numbers; old clients ignore them. ✅ Remove fields only by marking them reserved (number and name). ❌ Never reuse or renumber a field, or change its…

Key Takeaways