Graphene + Sqlalchemy

Hi there!

I’m trying to make the most simple test example of graphene + sqlalchemy to work, but I can’t figure out one point. I manage to create my models and schemas, but once I make a request I always get this error graphql.error.located_error.GraphQLLocatedError: A query in the model Base or a session in the schema is required for querying., this seems to be related to this. But I tried both suggested solutions, none seems to work. By the way Base.query is None in my tests, even though session.query_property() is not None. I must be missing something obvious here, but I have no idea what.

Thanks for your help.

I found a way to make this work, but I have to add the query to each of my sqlalchemy Base class. For example :

class Customer(Base):
    __tablename__ = 'customer'
    query = session.query_property()
    ....