QuickDevGuide

Home › GraphQL & gRPC

gRPC Deadlines, Status Codes & Metadata — GraphQL & gRPC

Deadlines Every call should have a deadline. Without one, a slow dependency can hold resources forever. Deadlines propagate: a server calling another service should pass on the remaining time. Status codes (not HTTP codes) Code Meaning OK (0) success INVALIDARGUMENT (3) bad input — don't retry DEADLINEEXCEEDED (4) took too long NOTFOUND (5) / ALREADYEXISTS (6) resource state PERMISSIONDENIED (7) / UNAUTHENTICATED (16) auth RESOURCEEXHAUSTED (8) rate limited / quota UNAVAILABLE (14) transient — safe to retry with backoff INTERNAL (13) server bug Metadata Key/value headers sent with a call (authorization, x-request-id). Binary keys end in -bin. Servers read call.metadata and can send initial/trailing metadata back. Interceptors apply cross-cutting logic (auth, logging, retries) to every…

Key Takeaways