Skip to content

Run scalar partials without lazy resolvers - #5740

Merged
rmosolgo merged 1 commit into
rmosolgo:masterfrom
ydah:fix-next-scalar-partials
Sep 16, 2026
Merged

rmosolgo merged 1 commit into
rmosolgo:masterfrom
ydah:fix-next-scalar-partials

Conversation

@ydah

@ydah ydah commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

GraphQL::Execution::Runner only initializes its lazy-value cache when the schema has configured lazy resolvers.

Most calls to Runner#lazy? are guarded by resolves_lazies, but run_isolated_scalar calls it unconditionally. As a result, running an Execution::Next partial for a scalar or enum path on a schema without lazy_resolve raises:

NoMethodError: undefined method `[]' for nil

This PR applies the same resolves_lazies guard used by the other call sites before checking the partial value. Schemas with lazy resolvers continue to resolve lazy scalar values, while schemas without them skip the unavailable cache.

It also adds regression coverage using a schema without configured lazy resolvers.

@rmosolgo

Copy link
Copy Markdown
Owner

Nice, thanks! Out of curiosity, how did you find this bug? Were you running a partial on a scalar in your app?

@rmosolgo rmosolgo added this to the 2.6.11 milestone Sep 16, 2026
@rmosolgo
rmosolgo merged commit 0ac6885 into rmosolgo:master Sep 16, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants