@@ -266,8 +266,10 @@ async def resolve_connection_async(iterable):
266
266
iterable = await iterable
267
267
if iterable is None :
268
268
iterable = default_manager
269
- ## This could also be async
270
- iterable = queryset_resolver (connection , iterable , info , args )
269
+
270
+ iterable = await sync_to_async (queryset_resolver )(
271
+ connection , iterable , info , args
272
+ )
271
273
272
274
if info .is_awaitable (iterable ):
273
275
iterable = await iterable
@@ -280,19 +282,21 @@ async def resolve_connection_async(iterable):
280
282
281
283
if iterable is None :
282
284
iterable = default_manager
283
- # thus the iterable gets refiltered by resolve_queryset
284
- # but iterable might be promise
285
- iterable = queryset_resolver (connection , iterable , info , args )
286
285
287
286
try :
288
287
get_running_loop ()
289
288
except RuntimeError :
290
289
pass
291
290
else :
291
+ iterable = sync_to_async (queryset_resolver )(
292
+ connection , iterable , info , args
293
+ )
292
294
return sync_to_async (cls .resolve_connection )(
293
295
connection , args , iterable , max_limit = max_limit
294
296
)
295
297
298
+ iterable = queryset_resolver (connection , iterable , info , args )
299
+
296
300
return cls .resolve_connection (connection , args , iterable , max_limit = max_limit )
297
301
298
302
def wrap_resolve (self , parent_resolver ):
0 commit comments