class GraphQL::Relay::Mutation::Result
It delegates field lookups to the hash returned from ‘resolve`.
Use this when the mutation’s return type was generated from ‘return_field`s.
def self.define_subclass(mutation_defn)
def self.define_subclass(mutation_defn) subclass = Class.new(self) do attr_accessor(*mutation_defn.return_type.all_fields.map(&:name)) self.mutation = mutation_defn end subclass end
def initialize(client_mutation_id:, result:)
def initialize(client_mutation_id:, result:) @client_mutation_id = client_mutation_id result && result.each do |key, value| self.public_send("#{key}=", value) end end