Skip to content

Session is None in batch_load_fn #370

@msmedes

Description

@msmedes

Versions:

graphene==2.1.9
graphene-sqlalchemy==2.3.0
sqlalchemy==1.3.18
flask-sqlalchemy==2.4.4
flask==1.1.2

We've been using batching ever since we created our gql service but recently started randomly getting the error 'NoneType' object has no attribute 'dirty' on the line

assert parent not in session.dirty

and I noticed the above code comment at the top of the block
# These issues are very unlikely to happen in practice...

What are the conditions that would cause this issue to arise? Is SQLAlchemy just dropping a session mid-request? We are passing in the db.session object from flask-sqlalchemy to the flask graqphl view, and I'm guessing the issue has to do with session scoping?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions