<  Back to Schedule
GraphQL in ProductionLightning Talks

UNSET Fields: Differentiating Between Null and Purposeful Omissions in Your Server Response

Wednesday, September 11 / 03:40p.m. PDT - 03:50p.m. PDT
Janette Cheng Profile Image
Janette ChengMeta, Software Engineer

You've heard about distinguishing semantic vs error nulls, but what about "unset" fields? Unset fields are neither semantic or error nulls because the server has not calculated them. Why would something like this ever come up? - WhatsApp delta updates: When the client wants to tell the server, "This is the value I have for this field, only bother calculating it again and sending it down if it's out of date." - Instagram server migration from a non-GraphQL server: We started with a server that has multiple code paths to resolve a field, and now we are not guaranteed every field we request will always be resolved. Not being able to distinguish between null and unset is a problem we expect is more widespread, and to which we have found a not amazing solution that could be better if we update the spec. How do you distinguish "unset" from null? - How you achieve this today (not particularly elegant, but possible) - Omission from server response? (not currently spec-compliant)