Skip to content

Check for missing required variables before sending a request - #622

Open
noooooooookro wants to merge 1 commit into
graphql-python:masterfrom
noooooooookro:validate-request-variables
Open

noooooooookro wants to merge 1 commit into
graphql-python:masterfrom
noooooooookro:validate-request-variables

Conversation

@noooooooookro

Copy link
Copy Markdown

In #432, a missing $skip reached the server and its HTTP 500 response triggered retries. With a schema and Client(check_required_variables=True), gql raises a local GraphQLError for that request. The option is off by default.

Only variables declared by the selected operation are checked. A variable with a default can be omitted, and present values pass through without an extra coercion step. This covers the missing-variable case in #434.

The seven new tests pass on graphql-core 3.3.0a3. The default suite was also run on Linux with Python 3.11 and graphql-core 3.3.2, along with Black, flake8, isort, mypy and check-manifest.

@codecov

codecov Bot commented Dec 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7fb869a) to head (8e16479).
⚠️ Report is 80 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##            master      #622    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files           38        40     +2     
  Lines         2908      3343   +435     
==========================================
+ Hits          2908      3343   +435     

☔ 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.

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