mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-02 12:44:15 +03:00
Fixed connection data with wrapped resolver
This commit is contained in:
parent
65ece437a1
commit
c45417d5f0
|
@ -36,9 +36,9 @@ class ConnectionField(Field):
|
||||||
from graphene.relay.types import PageInfo
|
from graphene.relay.types import PageInfo
|
||||||
schema = info.schema.graphene_schema
|
schema = info.schema.graphene_schema
|
||||||
|
|
||||||
orig_resolved = super(ConnectionField, self).resolve(instance, args, info)
|
resolved = super(ConnectionField, self).resolve(instance, args, info)
|
||||||
if orig_resolved:
|
if resolved:
|
||||||
resolved = self.wrap_resolved(orig_resolved, instance, args, info)
|
resolved = self.wrap_resolved(resolved, instance, args, info)
|
||||||
assert isinstance(
|
assert isinstance(
|
||||||
resolved, Iterable), 'Resolved value from the connection field have to be iterable'
|
resolved, Iterable), 'Resolved value from the connection field have to be iterable'
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class ConnectionField(Field):
|
||||||
|
|
||||||
connection = connection_from_list(resolved, args, connection_type=connection_type,
|
connection = connection_from_list(resolved, args, connection_type=connection_type,
|
||||||
edge_type=edge_type, pageinfo_type=PageInfo)
|
edge_type=edge_type, pageinfo_type=PageInfo)
|
||||||
connection.set_connection_data(orig_resolved)
|
connection.set_connection_data(resolved)
|
||||||
return connection
|
return connection
|
||||||
|
|
||||||
@memoize
|
@memoize
|
||||||
|
|
Loading…
Reference in New Issue
Block a user