Skip to content

Don't crash analyzer when @skip/@include arg fails coercion#5633

Merged
rmosolgo merged 1 commit into
rmosolgo:masterfrom
artplan1:fix-null-directive-arg-analyzer-crash
May 14, 2026
Merged

Don't crash analyzer when @skip/@include arg fails coercion#5633
rmosolgo merged 1 commit into
rmosolgo:masterfrom
artplan1:fix-null-directive-arg-analyzer-crash

Conversation

@artplan1
Copy link
Copy Markdown
Contributor

@artplan1 artplan1 commented May 14, 2026

When null is passed for an @include(if: Boolean!) / @skip(if: Boolean!) argument (e.g. a nullable variable with a default sent as null), arguments_for returns a GraphQL::ExecutionError.
DirectiveChecks#include? then called args[:if] on it and raised NoMethodError, crashing any schema that runs an analyzer (max_depth, max_complexity, etc).
Skip the directive in that case so execution surfaces the error normally.

@rmosolgo
Copy link
Copy Markdown
Owner

Awesome, sorry for the trouble with this and thanks for sharing your fix!

@rmosolgo rmosolgo added this to the 2.6.3 milestone May 14, 2026
@rmosolgo rmosolgo merged commit 5075e45 into rmosolgo:master May 14, 2026
13 checks passed
@artplan1 artplan1 deleted the fix-null-directive-arg-analyzer-crash branch May 14, 2026 13:57
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