lib/graphql/relay/connection_resolve.rb in graphql-1.7.14 vs lib/graphql/relay/connection_resolve.rb in graphql-1.8.0.pre1
- old
+ new
@@ -39,9 +39,12 @@
def build_connection(nodes, args, parent, ctx)
if nodes.is_a? GraphQL::ExecutionError
ctx.add_error(nodes)
nil
else
+ if parent.is_a?(GraphQL::Schema::Object)
+ parent = parent.object
+ end
connection_class = GraphQL::Relay::BaseConnection.connection_for_nodes(nodes)
connection_class.new(nodes, args, field: @field, max_page_size: @max_page_size, parent: parent, context: ctx)
end
end