Fixed bug related to wrong use of GraphQL::Relay connection helper

This commit is contained in:
Alberto Miedes Garcés
2016-12-05 18:42:17 +01:00
parent fdea4ad6ac
commit 42355e770c

View File

@@ -34,11 +34,11 @@ module GraphQL
when :belongs_to
field(association.name, -> { type_creator.created_types[association.klass] })
when :has_many
connection association.name, -> do
type_creator.created_types[association.klass].connection_type do
description "#{association.klass.model_name.human.pluralize}"
resolve -> (object, arguments, context) { association.klass.all }
end
connection(
association.name,
Proc.new { type_creator.created_types[association.klass].connection_type }
) do
resolve -> (object, arguments, context) { association.klass.all }
end
end
end