Fix casting??
This commit is contained in:
Родитель
bd882d98e8
Коммит
9b27fd94ec
|
@ -117,8 +117,14 @@ module GraphQL
|
|||
end
|
||||
when GraphQL::Client::Schema::ObjectType::WithDefinition
|
||||
case obj
|
||||
when nil, schema_class.klass
|
||||
obj
|
||||
when schema_class.klass
|
||||
if obj.definer == schema_class
|
||||
obj
|
||||
else
|
||||
cast_object(obj)
|
||||
end
|
||||
when nil
|
||||
nil
|
||||
when Hash
|
||||
schema_class.new(obj, errors)
|
||||
else
|
||||
|
|
|
@ -24,6 +24,8 @@ module GraphQL
|
|||
end
|
||||
|
||||
module Defined
|
||||
attr_reader :definer
|
||||
|
||||
def initialize(data = {}, errors = Errors.new, definer)
|
||||
super(data, errors)
|
||||
@definer = definer
|
||||
|
@ -59,7 +61,7 @@ module GraphQL
|
|||
include BaseType
|
||||
include ObjectType
|
||||
|
||||
attr_reader :defined_fields, :definition, :spreads
|
||||
attr_reader :klass, :defined_fields, :definition, :spreads
|
||||
|
||||
def type
|
||||
@klass.type
|
||||
|
|
Загрузка…
Ссылка в новой задаче