-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Sibling errors should not be added after propagation #4458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 16.x.x
Are you sure you want to change the base?
Conversation
benjie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good, minimal additional memory cost, reasonably efficient checks for existing errors, and zero cost if errors don't occur. The main memory cost is retaining path objects beyond their previous lifecycle, but that's incredibly marginal unless you have millions of errors - and if that's the case you have bigger issues.
Let's make hasNulledPosition more efficient, but that's my only requested change. WDYT, @JoviDeCroock?
|
@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. |
Co-authored-by: Benjie <benjie@jemjie.com>
7e7e91a to
8893d15
Compare
benjie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My one concern with this is that in future iteration people may not know to update errors and errorPositions concurrently.
Can we add a method to execution context to register errors instead (e.g. exeContext.addError(error, path)) and mark errors and errorPositions as readonly in ExecutionContext to discourage alternative manipulation?
added CollectedErrors utility class
|
@benjie i added a CollectedErrors utility class to more tightly couple |
Implementation of:
graphql/graphql-spec#1184
@benjie