Nullability WG ·
Nullability WG meetings · Jump to notesAgenda
Nullability WG — May 2024
The Nullability WG (Working Group) is a subcommittee of the GraphQL Spec WG tasked with improving the experience around nullability in GraphQL. It was previously known as the Client Controlled Nullability WG, but now includes server-side solutions within its scope also.
This is an open meeting in which anyone in the GraphQL community may attend. We typically meet on the last Wednesday
- Date & Time: May 22, 2024, 7:00 – 8:00 PM UTC
- View the calendar, or subscribe (Google Calendar, ical file).
- Please Note: The date or time may change. Please check this agenda the week of the meeting to confirm. While we try to keep all calendars accurate, this agenda document is the source of truth.
- Video Conference Link: https://zoom.us/j/95723407712?pwd=ZHhQakxqd1JlTnZJNTJXdlN3UFdQUT09
- Live Notes: Live Notes
Attendees
| Name | GitHub | Organization | Location |
|---|---|---|---|
| Benjie Gillam | @benjie | Graphile | Chandler's Ford, UK |
| Alex Reilly | @twof | Independent | San Francisco, CA, USA |
| Janette Cheng | @janettec | Meta | London, UK |
| Calvin Cestari | @calvincestari | Apollo | Vancouver, BC |
| Jordan Eldredge | @captbaritone | Meta (Relay) | London, UK |
| Ernie Turner | @ernieturner | Coinbase | Bozeman, MT, USA |
| Stephen Spalding | @fotoetienne | Netflix | Los Gatos, CA, USA |
Agenda
- Agree to Membership Agreement, Participation & Contribution Guidelines and Code of Conduct (1m, Host)
- Introduction of attendees (5m, Host)
- Determine volunteers for note taking (1m, Host)
- Review agenda (2m, Host)
- Review previous meeting's action items (5m, Host)
- Semantic nullability schema proposal (45m, Benjie)
- GraphQL Conf Panel (5m, Stephen)
Notes
Client Controlled Nullability WG - May 2024
Watch the replay: GraphQL Working Group Meetings on YouTube
Attendees:
- Benjie
- Alex
- Janette
- Calvin
- Jordan
- Ernie
- Stephen
- Tom
Notes:
GraphQL Conference Panel
- Being submitted by Stephen.
- [Jordan] Submitting a talk about semantic nullability more broadly. Itamar also is also submitting a talk about the @catch directive and its value.
Semantic Nullability Schema
- [Benjie] presentation of Semantic Nullability Schema Proposal (slides)
- [Jordan] Gut feeling is that this solves lots of the prior ideas, is more palatable for day-to-day setup and schema authoring. Tight coupling with null-bubbling took a bit to understand, but favoring it over other prior proposals.
- [Stephen] Props to Benjie for the proposal and presenting it. Think its the
best form of nullability we’ve seen. Challenges of getting it through: ideas
of introducing a pragma, like how it is limited to just SemanticNullability,
general concept. Bikeshed would be on the syntax, might like option 2 (?, no
annotation, !). With semantic nullability does optional-by-default make sense?
- [Benjie] Question marks are more clear, but unadorned type in old vs new is a barrier.
- [Tom] How does this work in a federated world? Single pragma for the entire
subgraph?
- [Benjie] Supergraph can’t say it supports no-null-bubbling if subgraphs do not. A supergraph could only send no-null-bubbling only if all subgraphs of a request do so. Clients could ask for the mode to use.
- [Jordan] As a server, if I don’t know anything about semantic null, it could still support no-non-bubbling.
- [Jordan] Even for existing clients who predate this, you can give them a schema that still represents the existing state of the world.
- [Calvin] Doc proposal doesn’t have second syntax option. Correct.
- [Alex] After this proposal is implemented, do we imagine most/all apps have
pragma in their schema?
- [Benjie] Introspection is the source of truth, so depends on clients using the schema. Particular clients that handles nulls by throwing out responses that has any errors. For them, they would want to use semantic non-null. New schema makes sense. Traditional clients with type generation to look at data, they want to use traditional mode. Advanced clients want to use semantic mode, but re-implement other mode for consumers. So both are useful, not a GraphQL 2.0 proposal. Pragma addition makes it obvious what mode you’re in.
- [Jordan] Very simple error handling clients that discard responses with any
error, the error bubbling they would like is to stop executing the query at
first error. Is there value in not having null bubbling be binary, but a
middle-ground.
- [Benjie] Possible option from clients to send in besides just SEMANTIC. Other clients, such as fetch, don’t have normalized store, so you want strong types. Partial failure in a traditional client (as it exists today). Still want traditional mode.
- [Jordan] Any client can see the simplified representation of the schema.
- [Benjie] Semantic non-null and strict non-null are the same in semantic mode. In traditional mode, a semantically non-null position will never be null unless an error.
- [Ernie] presented to his team yesterday. They got stuck on the strict (!!)
syntax. As a schema author, how do I decide?
- [Benjie] Default is nullable. Then think “Is this guaranteed to never be
null?” If so, this is semantically non-null. If a user will always have a
username, that is semantically non-null
- Is it both guaranteed to never be null and to never throw an error? Then it’s (!!). If something goes wrong, then the entire object is now meaningless
- [Jordan] It’s “kills parent on exception”. It’s not really about nullability
- [Ernie] But this will never happen in non-null-bubbling mode
- [Benjie] Default is nullable. Then think “Is this guaranteed to never be
null?” If so, this is semantically non-null. If a user will always have a
username, that is semantically non-null
- [Ernie] Will Relay treat a field differently with ! vs !!?
- [Jordan] No. The only people that case about that distinction are the intersection of want to deal with errors and have type generation, but don’t have more sophisticated error handling. It’s a bridge
- [Jordan] This is almost all clients today
- [Jordan] Strawberry client. They don’t do null by default.
- [Benjie] When a client in non-null-bubbling mode performs introspection, it will never see strict nullability. It won't have (!!)
- [Alex] Can you walk us through - if I’m a user of Apollo/Relay, what would the
upgrade path look like from the current mode to non-null-bubbling mode
- [Benjie] I’d imagine Relay switch to always requesting non-null-bubbling
- For clients that don’t want that effort (for example fetch client), it would be a breaking change because everywhere you thought of as non-nullable can be null if an error happens
- Would be non-breaking if you already throw out responses on error
- [Benjie] I’d imagine Relay switch to always requesting non-null-bubbling
- [Alex] writing user stories in the doc would be helpful
- Next steps:
- [Benjie] move doc to github
- [Jordan] Add user stories
- [Jordan] I am going to talk to more client/server authors. If you have anyone in mind, reach out
- [Tom] If you want federation world, fed spec, talk to wundergraph folks
- [Benjie] Also composite schemas working group
- [Jordan] If Stellate or anyone is doing normalized caching this would be of interest