Skip to content

Conversation

@yaacovCR
Copy link
Contributor

Implementation of:

graphql/graphql-spec#1184

@benjie

benjie
benjie previously requested changes Nov 7, 2025
Copy link
Member

@benjie benjie left a 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?

@vercel
Copy link

vercel bot commented Dec 23, 2025

@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 force-pushed the save-null-positions branch from 7e7e91a to 8893d15 Compare December 23, 2025 11:18
@yaacovCR yaacovCR dismissed benjie’s stale review December 23, 2025 11:20

review suggestion merged!

benjie
benjie previously requested changes Dec 23, 2025
Copy link
Member

@benjie benjie left a 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?

@yaacovCR yaacovCR dismissed benjie’s stale review December 23, 2025 12:32

added CollectedErrors utility class

@yaacovCR
Copy link
Contributor Author

@benjie i added a CollectedErrors utility class to more tightly couple errors and errorPositions

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

Labels

spec RFC Implementation of a proposed change to the GraphQL specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants