Skip to content

chore: require webonyx/graphql-php 15.38.3 and drop the QueryComplexity override - #45

Closed
oojacoboo wants to merge 1 commit into
masterfrom
chore/require-webonyx-15-38-3
Closed

oojacoboo wants to merge 1 commit into
masterfrom
chore/require-webonyx-15-38-3

Conversation

@oojacoboo

Copy link
Copy Markdown
Owner

Problem

webonyx/graphql-php 15.38.3 (webonyx/graphql-php#1969) changed its QueryComplexity rule: a variable that fails coercion is now reported through the validation context, one error per variable with the location of its definition, and complexity analysis stops for the document. Before, the rule threw a single error joining every coercion message, without locations.

That is what thecodingmachine#839's TheCodingMachine\GraphQLite\Validator\Rules\QueryComplexity subclass worked around. On 15.38.3 and later its catch never runs, and its test testInvalidVariableOfAnotherOperationKeepsTheLimit, which asserts the error has no locations, fails with the latest dependencies (it fails on master today; upstream's last green run predates the webonyx release).

Fix

Tests

tests/Integration/QueryComplexityTest.php::testInvalidVariableIsRefusedWithItsLocation keeps asserting one error per invalid variable, with its location, through the GraphQLite fixture schema and webonyx's rule. Run locally on PHP 8.5 with composer update (webonyx 15.39.0) and composer update --prefer-lowest (webonyx 15.38.3): phpunit 729 OK, phpstan no errors, phpcs clean.

…ty override

webonyx 15.38.3 (webonyx/graphql-php#1969) reports variable coercion errors from its
QueryComplexity rule through the validation context, one located error per variable, instead
of throwing a single joined error. That is what thecodingmachine#839's subclass did, so on 15.38.3 its catch
never runs, and its test asserting no locations fails on current webonyx.

limitQueryComplexity() registers webonyx's rule again. The unreleased subclass and its unit
test are removed; the integration test keeps asserting a located error per invalid variable.
@oojacoboo oojacoboo closed this Nov 3, 2026
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.

1 participant