Received incompatible instance \"<coroutine object get_batch_resolver.<locals>.resolve at 0x1080d6840>
When following the tutorial at https://docs.graphene-python.org/projects/sqlalchemy/en/latest/tutorial/ and using the following packages
asgiref==3.4.1
Flask==2.0.2
graphene==3.0
graphene-sqlalchemy==3.0.0b1
graphql-core==3.1.6
graphql-server[flask]==3.0.0b4
graphql-relay==3.1.0
uvicorn==0.16.0
gunicorn==20.1.0
to run an ASGI uvicorn server with flask (though it doesn't work if i just type flask run either), I execute the graphql command
{
allEmployees {
edges {
node {
id
name
department {
name
}
}
}
}
}
And get a bunch of errors that say:
Received incompatible instance \"<coroutine object get_batch_resolver.<locals>.resolve at 0x1080d6840>
I looked deeper into it and it looks like the batch_load_fn in the batching.py file might not be awaited. Is this an error on the flask end? My code itself is exactly the same as the tutorials.
Was able to reproduce this issue in a similar case using FastAPI and graphene-starlette3. Seems to be non-breaking with regards to query resolution though. Has anyone found any fix to that yet?
TODO: re-check with #169 merged, might be a suppressed underlying SQLAlchemy exception.
The graphene-SQLAlchemy part of this issue should be solved with the latest dataloader changes. To support async dataloaders, you need to make sure to use an asyncio-compatible server library such as starlettewith starlette-graphene3, or customize the flask GraphQLView of graphql-server to support an event loop.
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.