Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement onError proposal #4364

Draft
wants to merge 7 commits into
base: 16.x.x
Choose a base branch
from
Draft

Implement onError proposal #4364

wants to merge 7 commits into from

Conversation

benjie
Copy link
Member

@benjie benjie commented Mar 27, 2025

Copy link

Hi @benjie, I'm @github-actions bot happy to help you with this PR 👋

Supported commands

Please post this commands in separate comments and only one per comment:

  • @github-actions run-benchmark - Run benchmark comparing base and merge commits for this PR
  • @github-actions publish-pr-on-npm - Build package from this PR and publish it on NPM

@benjie

This comment has been minimized.

Copy link

@github-actions publish-pr-on-npm

@benjie The latest changes of this PR are available on NPM as
graphql@16.10.0-canary.pr.4364.6b142546832c1283b535908fb8c9a171b2f7cc20
Note: no gurantees provided so please use your own discretion.

Also you can depend on latest version built from this PR:
npm install --save graphql@canary-pr-4364

Copy link
Member

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not opposed to this but what are we doing with the directive that is present on main/v17?

*
* @experimental
*/
onError?: GraphQLErrorBehavior;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move this to the new options?: object that is in here, could maybe facilitate these experimental things better. Alternatively we stick to a flat config

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's specified to be part of the "GraphQL request", so I would expect it top level. I would consider moving some of the non-request properties to be inside an options object though: fieldResolver, typeResolver, subscribeFieldResolver.

@benjie benjie marked this pull request as draft April 10, 2025 14:58
@benjie
Copy link
Member Author

benjie commented Apr 10, 2025

I want to add an introspection field indicating the default error behavior of a schema, so I've moved this to draft.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants