Nullability WG ·

Nullability WG meetings · Jump to notes

Agenda

View agenda on GitHub

GraphQL CCN WG – February 2024

To read about the purpose of this subcommittee, please see the README.

This is an open meeting in which anyone in the GraphQL community may attend.

Attendees

NameGitHubOrganizationLocation
Alex Reilly@twofIndependentSan Francisco, CA, US
Jordan Eldredge@captbaritoneMeta (Relay)Alameda, CA, US

Agenda

  1. Agree to Membership Agreement, Participation & Contribution Guidelines and Code of Conduct (1m, Organizer)
  2. Introduction of attendees (5m, Organizer)
  3. Determine volunteers for note taking (1m, Organizer)
  4. Review agenda (2m, Organizer)
  5. Review previous meeting's action items (5m, Organizer)

Notes

View notes on GitHub

Client Controlled Nullability WG - February ad-hoc discussion on syntax

Attendees:

  • Alex Reilly
  • Benjie Gillam
  • Martin Bonnin
  • Ernie Turner
  • Jordan Eldredge
  • Benoit Lubek

Notes:

  • Benjie’s previous personal brainstorm: https://gist.github.com/benjie/19d784721d1658b89fd8954e7ee07034
  • Currently we have a base type and a non-nullable type, ideally semantic non-null is additive
  • Unclear if this will become the new default type, or if nullable will still be the sensible default
  • Not captured in doc !!
  • Another idea -!
  • Evaluation criteria
    • Is this a symbol we might want for some other feature in the future?
      • Angle brackets and parens might come at a high cost in terms of this
      • “Preserve option value”
    • Needs to be something that we’re comfortable writing a lot and reading alot
    • One challenge with prefix is that it leaves more room for conflicts or invalid syntax
    • Non-ascii characters come at a higher cost. Might rule out some options?
      • Note: British mac keyboards don’t have a hash character
    • Syntax which qualifies the bang seemed more intuitive than ones which tried to build up a new syntax from the base type
      • The ~ and the * both work linguistically
      • (someField!) also captures “non-null but with error boundary”. This even matches an early conceptualization of how the types would be represented internally in the spec
    • We should favor syntax that is intuitive for the client (reader) if we have to trade off between the client and server perspective
      • For example,
  • In general, we all prefer solutions which qualify the exclamation point
    • Feels more intuitive
    • Makes it easier to migrate a schema which has over-used non-null, however this is a breaking change
    • !*, ~!, !^, !!, -!, !?, ?!
    • ^ is commonly used for footnotes in Markdown, is visually less “heavy” than *
    • ~ is used as binary not in some languages which may imply a type of negation
    • Criteria
      • Is the order that one ought to use obvious?
  • We arrived at a top three which seemed to pull away from the rest as clear leaders. ~! is the favorite of the group, but all three are worth preserving and sharing with the larger group. All three have a basis in written English in which the additive symbol qualifies the ! in some way
    • ~!
      • Interpreted as “approximately not null”
      • Might be slightly preferable during lexing (no need to look ahead) but we already do look ahead, so not a meaningful difference
      • ~ is used as “bitwise not” in some languages which may imply a type of negation (likely not a practical issue since most GraphQL adjacent code is likely not doing bit bashing)
    • !*
      • Interpreted as “not null, with some caveat”
      • Visually too heavy in monospace
    • !^
      • Interpreted as “not null, with some caveat”
      • Harder to say aloud
      • Name may be unclear/ambiguous: “Bang carrot” or “Bang circumflex”
      • Often seen as a secondary “footnote” character to be used after * has already been taken. That said, commonly used for footnotes in Markdown
  • Going from nullable to semantic non-null is a non-breaking change

Additional notes

View additional notes on GitHub

Client Controlled Nullability WG - February 2024

Watch the replay: GraphQL Working Group Meetings on YouTube

Attendees:

  • Alex Reilly
  • Benjie Gillam
  • Martin Bonnin
  • Ernie Turner
  • Jordan Eldredge
  • Benoit Lubek

Notes:

  • Benjie’s previous personal brainstorm: https://gist.github.com/benjie/19d784721d1658b89fd8954e7ee07034
  • Currently we have a base type and a non-nullable type, ideally semantic non-null is additive
  • Unclear if this will become the new default type, or if nullable will still be the sensible default
  • Not captured in doc !!
  • Another idea -!
  • Evaluation criteria
    • Is this a symbol we might want for some other feature in the future?
      • Angle brackets and parens might come at a high cost in terms of this
      • “Preserve option value”
    • Needs to be something that we’re comfortable writing a lot and reading alot
    • One challenge with prefix is that it leaves more room for conflicts or invalid syntax
    • Non-ascii characters come at a higher cost. Might rule out some options?
      • Note: British mac keyboards don’t have a hash character
    • Syntax which qualifies the bang seemed more intuitive than ones which tried to build up a new syntax from the base type
      • The ~ and the * both work linguistically
      • (someField!) also captures “non-null but with error boundary”. This even matches an early conceptualization of how the types would be represented internally in the spec
    • We should favor syntax that is intuitive for the client (reader) if we have to trade off between the client and server perspective
      • For example,
  • In general, we all prefer solutions which qualify the exclamation point
    • Feels more intuitive
    • Makes it easier to migrate a schema which has over-used non-null, however this is a breaking change
    • !*, ~!, !^, !!, -!, !?, ?!
    • ^ is commonly used for footnotes in Markdown, is visually less “heavy” than *
    • ~ is used as binary not in some languages which may imply a type of negation
    • Criteria
      • Is the order that one ought to use obvious?
  • We arrived at a top three which seemed to pull away from the rest as clear leaders. ~! is the favorite of the group, but all three are worth preserving and sharing with the larger group. All three have a basis in written English in which the additive symbol qualifies the ! in some way
    • ~!
      • Interpreted as “approximately not null”
      • Might be slightly preferable during lexing (no need to look ahead) but we already do look ahead, so not a meaningful difference
      • ~ is used as “bitwise not” in some languages which may imply a type of negation (likely not a practical issue since most GraphQL adjacent code is likely not doing bit bashing)
    • !*
      • Interpreted as “not null, with some caveat”
      • Visually too heavy in monospace
    • !^
      • Interpreted as “not null, with some caveat”
      • Harder to say aloud
      • Name may be unclear/ambiguous: “Bang carrot” or “Bang circumflex”
      • Often seen as a secondary “footnote” character to be used after * has already been taken. That said, commonly used for footnotes in Markdown
  • Going from nullable to semantic non-null is a non-breaking change