Django – working example of graphene aiodataloader

Django – working example of graphene aiodataloader


0

I’ve been looking into using a DataLoader in Django to optimise Graphene resolvers. I have been having trouble finding a working example of this as it requires multi threading. Based on what I can tell, there is no longer a way to specify executors in the latest versions of GraphQL in python. Does anyone have a working setup as an example?

I was following the example below, and everytime I use async for my resolvers, I get:

RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-1_0'.

Which I think makes sense because GraphQL is using a sync executor by default (I stand corrected). I got this example from: https://docs.graphene-python.org/en/latest/execution/dataloader/

Share


Load 4 more related questions


Show fewer related questions

0

Reset to default



Browse other questions tagged

or ask your own question.

Leave a Reply

Your email address will not be published. Required fields are marked *