Skip to content

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

Merged
oojacoboo merged 1 commit into
thecodingmachine:masterfrom
oojacoboo:chore/require-webonyx-15-38-3
Nov 3, 2026
Merged

oojacoboo merged 1 commit into
thecodingmachine:masterfrom
oojacoboo:chore/require-webonyx-15-38-3

Conversation

@oojacoboo

@oojacoboo oojacoboo commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

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 #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).

Fix

  • Require webonyx/graphql-php ^v15.38.3.
  • Psr15GraphQLMiddlewareBuilder::limitQueryComplexity() registers webonyx's QueryComplexity rule again.
  • Remove the subclass and its unit test. The subclass hasn't been released (it landed after 8.3.1), so nothing depends on it.
  • Remove the docs paragraph recommending the subclass, and reword the fix: leave invalid variables to the executor under limitQueryComplexity() #839 CHANGELOG entry: the located errors now come from the webonyx requirement.

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.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.08%. Comparing base (53f9d49) to head (8cb446d).
⚠️ Report is 183 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #844      +/-   ##
============================================
- Coverage     95.72%   92.08%   -3.64%     
- Complexity     1773     2164     +391     
============================================
  Files           154      204      +50     
  Lines          4586     5751    +1165     
============================================
+ Hits           4390     5296     +906     
- Misses          196      455     +259     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oojacoboo
oojacoboo merged commit ba5882d into thecodingmachine:master Nov 3, 2026
12 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