flask_sqlalchemy example : different types with the same name in the schema: EmployeeConnection, EmployeeConnection.
See original GitHub issueHi,
I followed the instruction to use the flask_sqlalchemy example with a Python 2.7 version, when I run the app.py script, I’ve got the following error :
(py27) λ python app.py
Traceback (most recent call last):
File "app.py", line 7, in <module>
from schema import schema
File "D:\Thomas\Dev\graphene-sqlalchemy\examples\flask_sqlalchemy\schema.py", line 60, in <module>
schema = graphene.Schema(query=Query, types=[Department, Employee, Role])
....
File "D:\Programmes\Anaconda2\envs\py27\lib\site-packages\graphene\types\typemap.py", line 99, in graphene_reducer
).format(_type.graphene_type, type)
AssertionError: Found different types with the same name in the schema: EmployeeConnection, EmployeeConnection.
What am I doing wrong ?
Thank you
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:29 (3 by maintainers)
Top Results From Across the Web
graphql-python - Bountysource
flask_sqlalchemy example : different types with the same name in the schema: EmployeeConnection, EmployeeConnection. $ 0. Created 4 years ago in graphql-python/ ...
Read more >SQLAlchemy + Flask Tutorial - Graphene-Python
In this example, we provide the ability to list all employees via all_employees , and the ability to obtain a specific node via...
Read more >Using same name of tables with different binds in Flask
Use separate declarative base classes for different databases with the same name, to prevent sharing of SQLAlchemy metadata.
Read more >The Type Hierarchy - SQLAlchemy 1.4 Documentation
Database types are represented using Python classes, all of which ... have an explicit name in order to support schema-management concerns.
Read more >Graphene Documentation - Read the Docs
1 SQLAlchemy + Flask Tutorial. 3. 1.1. SetuptheProject . ... Create flask_sqlalchemy/schema.py and type the following:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@suxin1 thank you for your code but i was lazy reading it 😃 anyway, the fix is as simple as replacing “EmployeeConnection” with “EmployeeConnections”, following post helped me identify root cause: https://github.com/graphql-python/graphene-django/issues/185#issuecomment-388469296 hope will help someone else, all the best.
I solved this problem by changing a few names in schema.py, here is my code:
But why? I do not know, just lucky.