Skip to content
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

Flask-GraphQL now returns warnings when using `graphql-core #71

Closed
traviscook21 opened this issue Jan 24, 2020 · 3 comments · Fixed by #74
Closed

Flask-GraphQL now returns warnings when using `graphql-core #71

traviscook21 opened this issue Jan 24, 2020 · 3 comments · Fixed by #74

Comments

@traviscook21
Copy link

Now that the minimum version of graphql-core was bumped to >=2.3 we're now seeing warnings returning when running tests that leverage Flask-GraphQL.

Here's the relevant diff between graphql-core 2.2.1 and 2.3:
graphql-python/graphql-core@v2.2.1...v2.3.0#diff-a2c439ae03cccc507934c1377530d14aL74-L87

In graphqlview.py - arguments are being passed as root and context though it seems these arguments are getting deprecated in favor of root_value and context_value.

root=self.get_root_value(),
context=self.get_context(),

Here's the relevant DeprecationWarning

DeprecationWarning: The 'context' alias has been deprecated. Please use 'context_value' instead.
DeprecationWarning: The 'root' alias has been deprecated. Please use 'root_value' instead.
@Cito
Copy link
Member

Cito commented Jan 24, 2020

Yes, the "_value" prefix has been added back in Core 2.3, to make the API consistent with GraphQL.js and Core 3 again. So this should be changed in Flask-GraphQL as well to remove the warnings.

@KingDarBoja
Copy link
Contributor

KingDarBoja commented Feb 12, 2020

This only requires changes on the provided execute options in flask according to the executor. graphql-core diff 2.2.1 - 2.3 and bumping the minimum graphql-core version at setup.py, right?

@Cito
Copy link
Member

Cito commented Feb 13, 2020

Yes. Of course it would be also great to have a flask-graphql v3 based on graphql-core v3.

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 a pull request may close this issue.

3 participants