Class: GraphQL::Relay::Mutation::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/relay/mutation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arguments:, result:) ⇒ Result

Returns a new instance of Result.



127
128
129
130
# File 'lib/graphql/relay/mutation.rb', line 127

def initialize(arguments:, result:)
  @arguments = arguments
  @result = result
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



136
137
138
139
140
141
142
# File 'lib/graphql/relay/mutation.rb', line 136

def method_missing(name, *args, &block)
  if result.key?(name)
    result[name]
  else
    super
  end
end

Instance Attribute Details

#argumentsObject (readonly)

Returns the value of attribute arguments.



126
127
128
# File 'lib/graphql/relay/mutation.rb', line 126

def arguments
  @arguments
end

#resultObject (readonly)

Returns the value of attribute result.



126
127
128
# File 'lib/graphql/relay/mutation.rb', line 126

def result
  @result
end

Instance Method Details

#clientMutationIdObject



132
133
134
# File 'lib/graphql/relay/mutation.rb', line 132

def clientMutationId
  arguments[:input][:clientMutationId]
end