-
Notifications
You must be signed in to change notification settings - Fork 72
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
New version of graphql-core breaks package #29
Comments
This is already fixed in master, but it needs to be released on PyPI - see #28. |
This has now been released as v1.1.2. Let me know if there are still any problems. |
Pinning The package is now at version What needs to happen to upgrade |
@pgzmnk v3.0.0b4 already supports graphql-core >= 3.1. What we need is people reporting whether there are still issues with this beta version or whether it works nicely, and when everything looks ok, somebody who would cut a final release. I am currently working on graphql-core 3.2, but would be willing to test and help after I have released that. |
@jkimbo what do you think? |
@Cito This is great to hear. Here's the scenario: I'm upgrading a Python 3.9.7 pip freeze:
app.py import os
from flask import Flask
from flask_cors import CORS
from graphql_server.flask import GraphQLView
# from flask_graphql import GraphQLView # produces same error
import src.models
from src.extensions import db
from src.schema import schema
app = Flask(__name__)
app.debug = True
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv("SQLALCHEMY_DATABASE_URI")
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
CORS(app)
app.add_url_rule(
'/graphql',
view_func=GraphQLView.as_view(
'graphql',
schema=schema,
graphiql=True
)
)
db.init_app(app)
if __name__ == '__main__':
app.run() Log:
There seems to be an outdated import statement. Relevant discussion: graphql-python/graphene#1086 |
This looks like you have actually intstalled a very old (1.1.3 or so) version of graphql-server, 3.0.0b4 should not throw that error. Are you sure you ran the pip freeze with that demo_graphene/.venv activated? |
This is the observed output with a fresh .venv.
Uninstalling then reinstalling graphql-server then produces this different log, for the same pip freeze.
|
Setting
I will look into an alternative to Flask's |
In the second installation it looks like you have |
Thank you @Cito Setting schema to app.add_url_rule(
'/graphql',
view_func=GraphQLView.as_view(
'graphql',
schema=schema.graphql_schema,
graphiql=True
)
) Reference: https://issueexplorer.com/issue/graphql-python/graphene/1127#926804 |
Description
I am using Flask-GraphQL and since graphql-core:3 was released I get an import error.
See:
https://raw.githubusercontent.com/graphql-python/graphql-server-core/7ff9553602cf33b5b137eaa6e8bff62dd1377043/graphql_server/__init__.py
Suggested change
Pin dependency to
graphql-core==2.2.1
or even better upgrade to newer version of graphql-core.Workaround
In my case pinning
+graphql-core==2.2.1
worked.The text was updated successfully, but these errors were encountered: