Skip to content

fix: add extensions field to PayloadError per GraphQL spec#5289

Open
PHILLIPS71 wants to merge 3 commits into
facebook:mainfrom
PHILLIPS71:fix/payload-error-extensions
Open

fix: add extensions field to PayloadError per GraphQL spec#5289
PHILLIPS71 wants to merge 3 commits into
facebook:mainfrom
PHILLIPS71:fix/payload-error-extensions

Conversation

@PHILLIPS71
Copy link
Copy Markdown
Contributor

@PHILLIPS71 PHILLIPS71 commented May 21, 2026

The GraphQL spec (https://spec.graphql.org/September2025/#sec-Errors) states that errors may include an extensions entry whose value must be a map with no additional restrictions on its contents. PayloadError was missing this field.

This also propagates extensions through to TRelayFieldError so the field is preserved during normalization and available to consumers. As a side effect, stale inline type annotations in RelayErrorTrie.js that manually duplicated the error shape have been replaced with TRelayFieldError directly, and a mutation of a ReadonlyArray path via unshift has been replaced with an immutable spread.

@meta-cla meta-cla Bot added the CLA Signed label May 21, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented May 22, 2026

@evanyeung has imported this pull request. If you are a Meta employee, you can view this in D106027144.

@evanyeung
Copy link
Copy Markdown
Contributor

Nice catch! This looks correct as per the spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants