Skip to content

change transports prototype using GraphQLRequest #551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

leszekhanusz
Copy link
Collaborator

Everywhere in the code we are sending the document, variable_values and operation_name as arguments of the methods.
Now that we have a GraphQLRequest class which encapsulate those properties, it makes sense to use it instead.

Simplifying transport execute and subscribe methods prototypes by using a GraphQLRequest object intead of document, variable_values and operation_name

Potential breaking changes:

  • variable_values and operation_name are now keyword arguments only in client.py:
    you cannot do client.execute(query, params) anymore and need to do client.execute(query, variable_values=params) instead
  • if a custom transport is used, it would need to change its execute and subscribe prototype to conform to the new methods.

Copy link

codecov bot commented May 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (7fb869a) to head (5d234ed).
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #551   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        40    +2     
  Lines         2908      3005   +97     
=========================================
+ Hits          2908      3005   +97     

☔ View full report in Codecov by Sentry.
📢 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.

@leszekhanusz leszekhanusz merged commit ef49268 into graphql-python:master May 25, 2025
15 checks passed
@leszekhanusz leszekhanusz deleted the feature_change_transports_prototype_with_graphql_request branch May 25, 2025 20: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.

1 participant