mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-11 12:16:58 +03:00
parent
51c37fef98
commit
3df62d26a7
|
@ -5,7 +5,7 @@ from functools import partial
|
||||||
import six
|
import six
|
||||||
|
|
||||||
from graphql_relay import connection_from_list
|
from graphql_relay import connection_from_list
|
||||||
from promise import Promise
|
from promise import Promise, is_thenable, promisify
|
||||||
|
|
||||||
from ..types import (AbstractType, Boolean, Enum, Int, Interface, List, NonNull, Scalar, String,
|
from ..types import (AbstractType, Boolean, Enum, Int, Interface, List, NonNull, Scalar, String,
|
||||||
Union)
|
Union)
|
||||||
|
@ -142,8 +142,8 @@ class IterableConnectionField(Field):
|
||||||
resolved = resolver(root, args, context, info)
|
resolved = resolver(root, args, context, info)
|
||||||
|
|
||||||
on_resolve = partial(cls.resolve_connection, connection_type, args)
|
on_resolve = partial(cls.resolve_connection, connection_type, args)
|
||||||
if isinstance(resolved, Promise):
|
if is_thenable(resolved):
|
||||||
return resolved.then(on_resolve)
|
return promisify(resolved).then(on_resolve)
|
||||||
|
|
||||||
return on_resolve(resolved)
|
return on_resolve(resolved)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user