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

Using Flask-GraphQL and Flask-SQLAlchemy together? #14

Open
remingtonc opened this issue Nov 4, 2016 · 4 comments
Open

Using Flask-GraphQL and Flask-SQLAlchemy together? #14

remingtonc opened this issue Nov 4, 2016 · 4 comments

Comments

@remingtonc
Copy link

Based on the tutorial setup and personal testing, it doesn't appear that these two methods work in tandem. Any examples of these interoperating? Or should I switch to raw SQLAlchemy to support GraphQL?

@remingtonc
Copy link
Author

Moving issue to graphene-sqlalchemy as it is more applicable.

@syrusakbary
Copy link
Member

@remingtonc This might help https://github.com/graphql-python/graphene-sqlalchemy/tree/master/examples/flask_sqlalchemy :)

@remingtonc
Copy link
Author

remingtonc commented Nov 4, 2016

@syrusakbary Thank you! That is the tutorial I have been following, however I am attempting to use Flask-SQLAlchemy instead of SQLAlchemy alone. It does not appear to work out of the box when modeling using the convenience of Flask-SQLAlchemy.

This isn't a tremendous issue because I can always convert over to just SQLAlchemy, but it would be nice if they worked together. I could easily be wrong, and hope I am :)

I set the session:

schema = graphene.Schema()
schema.execute(context_value={'session': db.session})

On query:
{ "errors": [ { "message": "'NoneType' object has no attribute 'fields'" } ], "data": null }

@remingtonc remingtonc reopened this Nov 7, 2016
@nbyodai
Copy link

nbyodai commented Feb 9, 2017

@remingtonc I ran into this recently, any update since you reported? thanks

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

No branches or pull requests

3 participants