mirror of
https://github.com/graphql-python/graphene.git
synced 2025-03-04 20:05:48 +03:00
Move NonNull check
This commit is contained in:
parent
38baf7ab52
commit
c25bcb3345
|
@ -115,9 +115,6 @@ class IterableConnectionField(Field):
|
|||
|
||||
@classmethod
|
||||
def resolve_connection(cls, connection_type, args, resolved):
|
||||
if isinstance(connection_type, NonNull):
|
||||
connection_type = connection_type.of_type
|
||||
|
||||
if isinstance(resolved, connection_type):
|
||||
return resolved
|
||||
|
||||
|
@ -139,6 +136,9 @@ class IterableConnectionField(Field):
|
|||
def connection_resolver(cls, resolver, connection_type, root, info, **args):
|
||||
resolved = resolver(root, info, **args)
|
||||
|
||||
if isinstance(connection_type, NonNull):
|
||||
connection_type = connection_type.of_type
|
||||
|
||||
on_resolve = partial(cls.resolve_connection, connection_type, args)
|
||||
if is_thenable(resolved):
|
||||
return Promise.resolve(resolved).then(on_resolve)
|
||||
|
|
Loading…
Reference in New Issue
Block a user