Method: GraphQL::Query::Result#==

Defined in:
lib/graphql/query/result.rb

#==(other) ⇒ Boolean

A result is equal to another object when:

  • The other object is a Hash whose value matches result.to_h
  • The other object is a Result whose value matches result.to_h

(The query is ignored for comparing result equality.)

Returns:

  • (Boolean)


51
52
53
54
55
56
57
58
59
60
# File 'lib/graphql/query/result.rb', line 51

def ==(other)
  case other
  when Hash
    @to_h == other
  when Query::Result
    @to_h == other.to_h
  else
    super
  end
end