Comments (6)
I'd strongly advise using the 3.0 beta if you're starting off a new project. It works best together with an asyncio
-based framework like FastAPI
, but flask is also fine.
https://github.com/ciscorn/starlette-graphene3
This should work with flask + graphene 3: https://github.com/graphql-python/graphql-server
from graphene-sqlalchemy.
Someone suggested upgrading Flask-GraphQL to 2.0.1, here:
https://stackoverflow.com/questions/70204957/flask-graphql-import-fails
I'll try it.
"Successfully installed":
- Flask-GraphQL-2.0.1
- graphql-core-2.3.2
- rx-1.6.3
Now the error is:
ImportError: cannot import name 'GraphQLResolveInfo' from 'graphql' (/home/mwk/code/graphene-sqlalchemy/.venv/lib/python3.9/site-packages/graphql/__init__.py)
I used pip install Flask-GraphQL==2.0.1
, but someone in the same Stack Overflow post recommended putting flask-graphql>=2.0.1
in requirements.txt
instead. I'll try it.
Result: Pip conflict:
The conflict is caused by:
flask-graphql 2.0.1 depends on graphql-core<3 and >=2.1
graphene 3.2.1 depends on graphql-core<3.3 and >=3.1
[...]
flask-graphql 2.0.1 depends on graphql-core<3 and >=2.1
graphene 3.0b7 depends on graphql-core<4 and >=3.1.2
Interesting note from flask-graphql:
from graphene-sqlalchemy.
Going to try downgrading graphene-sqlalchemy (or Graphene itself?) from v3.0, because the README says:
Version 3.0 is in beta stage. Please read #348 to learn about progress and changes in upcoming beta releases.
Scratch this. Not sure which version I should downgrade to. Going to instead chase the errors by editing the pip packages.
from graphene-sqlalchemy.
Okay, flask-graphql's fix was to pin graphql-core to be under version 3.
However, the latest graphene versions require graphql-core to be over version 3.1.
So, I will try to find the latest graphene version that allows graphql-core to be under version 3.
The target version seems to be: graphene==2.1.9
Given this: https://pypi.org/project/graphene/#history
This leads to a new dependency error:
The user requested graphene==2.1.9 graphene-sqlalchemy 3.0.0b3 depends on graphene>=3.0.0b7
The target version seems to be: graphene-sqlalchemy==2.3.0
Given this: https://pypi.org/project/graphene-sqlalchemy/#history
from graphene-sqlalchemy.
Seems to be working now:
Approach: Downgrade.
How: Replace the entire contents of graphene-sqlalchemy/examples/flask_sqlalchemy/requirements.txt
with:
flask-graphql==2.0.1
graphene==2.1.9
graphene-sqlalchemy==2.3.0
from graphene-sqlalchemy.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related topics referencing this issue.
from graphene-sqlalchemy.
Related Issues (20)
- Enum cannot represent value HOT 5
- How to remove "edges" and "node" from query? HOT 9
- examples/flask_sqlalchemy: dependency specification needed, due to breaking change in graphql-core ^3 HOT 1
- Expand docs with batching example
- Global ids from objects with composite primary keys are not correctly extracted (again) HOT 3
- Hybrid properties don't work in the presence of future annotations HOT 6
- Prioritize custom type conversion over standard conversions HOT 1
- Relationship isn't working if a model has a property named other than 'id'. HOT 5
- Support for sqlalchemy ^2.0.0 HOT 7
- flask_sqlalchemy example does not run with v3 release HOT 2
- hybrid_property annotations with built-in types defaulting to `ForwardRef` and failing schema compilation HOT 2
- Default sort HOT 1
- ORMField batching results in null result HOT 1
- filter: Guys, did you forgot on DateTimeFilter? HOT 1
- Requiring graphene_type for custom filters as well as type hints HOT 1
- Allow a custom filter class with the purpose of using all the base filters, and adding sqlalchemy-filter esk filters
- A way to add custom filters not specific to fields
- Conversion of BigInteger primary keys to ID
- MVC: support business logic layer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphene-sqlalchemy.