GraphQL の onError と Nullability のこれから
DRANK

TranscriptGraphQL の onError と Nullability のこれから 2026.10.22 by @Quramy今日のテーマ:「‼する話」Null Propagation • 「Null を許容できるフィールドとなるまで型改装を遡上し、親を Null としていく」 • この挙動は GraphQLの仕様が定めている挙動 Since Non-Null response positions cannot be null, execution errors are propagated to be handled by the parent response position. If the parent response position may be null then it resolves to null, otherwise if it is a Non-Null type, the execution error is further propagated to its parent response position.最終合意案: onError • Nullability WG は「Null Propagation をやめる」という方針で解散された • 方法として提案されているのが、Executionへの onError オプション追加 ※ 2026.10現在 RFC 1(提案段階)。今すぐ使えるものではないことに留意 enum OnError { "PROPAGATE", "NULL", "HALT", } declare function execute(args: { schema: Schema, document: Document, Value Semantics PROPAGATE (default) フィールドエラーは親を遡り Null Propagation させる。 NULL フィー…

speakerdeck.com
Related Topics: