Build Confidently: How @Catch and Error Handling Pave Way in Field Nullability
summary
GraphQL clients stop treating every null as ambiguous by throwing actual exceptions when a field has server errors and by returning an inline union for caught fields so components can handle failures without dropping the whole render. Uses throw-on-field-error with JavaScript error boundaries and an inline @catch directive that yields {ok, value, errors}. This is implemented in Relay 18, rolled out at scale at Meta with query flags for incremental adoption, and prevents null-coercion bugs in UI code.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 1:32Current error handling issues
- 4:45The root cause in the spec
- 7:00Throwing on field errors
- 11:59The @catch directive
- 15:07Implementation and rollout
- 17:30Q&A session
related talks
13mError Boundaries Save You From Crashes! Here's How to Use It
24mA GraphQL Survival Kit
25mLeveraging (algebraic data) types to make your UI rock solid
08mLightning Talk: Resolvers Everywhere: Rethinking Client and Server Boundaries in GraphQL
11mForms Don't Need to Suck
24mBrute Force Correctness
23mGetting rid of runtime errors with Elm
19mGraphQL IRL: Pitfalls, Surprises and Successes
