lib/rails/graphql/request/strategy.rb
def resolve(field, *args, array: false, decorate: false, &block)
          rescue_with_handler(field: field) do
            if field.try(:dynamic_resolver?)
              prepared = @data_pool[field]
              args << Event.trigger(:resolve, field, self, prepared: prepared, &field.resolver)
            else
              data_for(args, field)
            end
          end if args.size.zero?

          value = args.last
          value = field.decorate(value) if decorate
          context.stacked(value) do |current|
            if !array
              block.call(current)
              field.write_value(current)
            else
              field.write_array(current, &block)
            end
          end
        end
# Resolve a value for a given object, It uses the +args+ to prevent
# problems with nil values.
Resolve a value for a given object, It uses the +args+ to prevent
problems with nil values.
Resolve a value for a given object It uses the + args + to prevent problems with nil values .
def resolve(field, *args, array: false, decorate: false, &block)
          rescue_with_handler(field: field) do
            if field.try(:dynamic_resolver?)
              prepared = @data_pool[field]
              args << Event.trigger(:resolve, field, self, prepared: prepared, &field.resolver)
            else
              data_for(args, field)
            end
          end if args.size.zero?
          value = args.last
          value = field.decorate(value) if decorate
          context.stacked(value) do |current|
            if !array
              block.call(current)
              field.write_value(current)
            else
              field.write_array(current, &block)
            end
          end
        end
def resolve ( field , * args , array : false , decorate : false , & block ) rescue_with_handler ( field : field ) do if field . try ( :dynamic_resolver? ) prepared = @data_pool [ field ] args << Event . trigger ( :resolve , field , self , prepared : prepared , & field . resolver ) else data_for ( args , field ) end end if args . size . zero? value = args . last value = field . decorate ( value ) if decorate context . stacked ( value ) do | current | if ! array block . call ( current ) field . write_value ( current ) else field . write_array ( current , & block ) end end end
Resolve a value for a given object, It uses the +args+ to prevent
problems with nil values.
Resolve a value for a given object It uses the + args + to prevent problems with nil values .
field
args
array
decorate
block