Skip to content

Adopt Error.cause in favor of originalError#4485

Merged
yaacovCR merged 2 commits into
graphql:17.x.xfrom
Malien:error-cause
Jun 1, 2026
Merged

Adopt Error.cause in favor of originalError#4485
yaacovCR merged 2 commits into
graphql:17.x.xfrom
Malien:error-cause

Conversation

@Malien

@Malien Malien commented Sep 27, 2025

Copy link
Copy Markdown
Contributor

The @depreacted marks might be heavy-handed. I am completely fine with reversing those.

For environments that don't have Error.cause (ES2021) @deprecated might be annoying to deal with, since they don't have the alternative.

Closes #4484

@Malien Malien requested a review from a team as a code owner September 27, 2025 10:23
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 27, 2025

Copy link
Copy Markdown

CLA Signed

  • ✅login: Malien / name: Yaroslav Petryk / (cd7dd84)

The committers listed above are authorized under a signed CLA.

@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

@yaacovCR is attempting to deploy a commit to the The GraphQL Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@yaacovCR yaacovCR changed the base branch from 16.x.x to 17.x.x June 1, 2026 22:19
@yaacovCR yaacovCR closed this Jun 1, 2026
@yaacovCR yaacovCR reopened this Jun 1, 2026
@yaacovCR

yaacovCR commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Thanks for this PR!!!!

Moved to 17.x.x where we can deprecate at will. Perhaps parts can be backported?

@yaacovCR yaacovCR added the PR: feature 🚀 requires increase of "minor" version number label Jun 1, 2026
@yaacovCR yaacovCR merged commit 550e511 into graphql:17.x.x Jun 1, 2026
22 of 23 checks passed
yaacovCR added a commit that referenced this pull request Jun 1, 2026
## v17.0.0-beta.2 (2026-06-02)

#### Breaking Change 💥
* [#4751](#4751) build: strip private discriminator from package types ([@yaacovCR](https://github.com/yaacovCR))
* [#4752](#4752) fix: discriminate between GraphQLNonNull and GraphQLList ([@yaacovCR](https://github.com/yaacovCR))
* [#4770](#4770) refactor: extract ExecutionArgs types to separate file ([@yaacovCR](https://github.com/yaacovCR))

#### New Feature 🚀
* [#4485](#4485) Adopt Error.cause in favor of originalError ([@Malien](https://github.com/Malien))

#### Bug Fix 🐞
* [#4739](#4739) chore(tests): add test for directive extensions without flag enabled (#4738) ([@yaacovCR](https://github.com/yaacovCR))
* [#4743](#4743) api: export VariableValues ([@yaacovCR](https://github.com/yaacovCR))
* [#4744](#4744) api: export ValidationOptions ([@yaacovCR](https://github.com/yaacovCR))
* [#4745](#4745) api: export SchemaChange ([@yaacovCR](https://github.com/yaacovCR))
* [#4746](#4746) api: export defer and stream validation rules ([@yaacovCR](https://github.com/yaacovCR))
* [#4747](#4747) api: export legacy incremental execution functions and helpers ([@yaacovCR](https://github.com/yaacovCR))
* [#4753](#4753) fix(build): development declaration stubs ([@yaacovCR](https://github.com/yaacovCR))
* [#4773](#4773) fix: FragmentVariableValueSource.value can be non-constant ([@yaacovCR](https://github.com/yaacovCR))
* [#4775](#4775) fix: remove unnecessary native promise coercion ([@yaacovCR](https://github.com/yaacovCR))

#### Docs 📝
<details>
<summary> 3 PRs were merged </summary>

* [#4742](#4742) docs: add v17 API docs lint coverage ([@yaacovCR](https://github.com/yaacovCR))
* [#4756](#4756) docs: hide private internals `schema.__validationErrors` and `inputValue._memoizedCoercedDefaultValue` ([@yaacovCR](https://github.com/yaacovCR))
* [#4758](#4758) docs: fix inline examples, deprecation descriptions, type category ([@yaacovCR](https://github.com/yaacovCR))
</details>

#### Polish 💅
* [#4774](#4774) test: restore GraphQLError no-stack coverage ([@yaacovCR](https://github.com/yaacovCR))

#### Internal 🏠
<details>
<summary> 3 PRs were merged </summary>

* [#4771](#4771) internal: drop node 20 integration tests ([@yaacovCR](https://github.com/yaacovCR))
* [#4772](#4772) internal: add deno 2.8.x to CI ([@yaacovCR](https://github.com/yaacovCR))
* [#4777](#4777) fix: preserve generated version documentation ([@yaacovCR](https://github.com/yaacovCR))
</details>

#### Committers: 2
* Yaacov Rydzinski ([@yaacovCR](https://github.com/yaacovCR))
* Yaroslav Petryk([@Malien](https://github.com/Malien))
yaacovCR added a commit to Malien/graphql-js that referenced this pull request Jun 2, 2026
my edits to graphql#4485 incorrectly passes originalError instead of cause for the stack-less cause test
yaacovCR pushed a commit that referenced this pull request Jun 2, 2026
I've authored #4485 long time ago. Since that PR sat there for a while,
I didn't get a chance to amend the design to not copy over the stack
from the `cause`.

Copying over the stack will just double up the same stack trace twice in
the reporting tooling / console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: feature 🚀 requires increase of "minor" version number

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can we align GraphQLError to utilize Error.cause?

2 participants