class GraphQL::Schema::Directive::Transform

def self.resolve(object, arguments, context)

Implement the Directive API
def self.resolve(object, arguments, context)
  path = context.namespace(:interpreter)[:current_path]
  return_value = yield
  transform_name = arguments[:by]
  if TRANSFORMS.include?(transform_name) && return_value.respond_to?(transform_name)
    return_value = return_value.public_send(transform_name)
    response = context.namespace(:interpreter_runtime)[:runtime].final_result
    *keys, last = path
    keys.each do |key|
      if response && (response = response[key])
        next
      else
        break
      end
    end
    if response
      response[last] = return_value
    end
    nil
  end
end