class GraphQL::Query::Result
A result from Schema.execute. It provides the requested data and access to the Query and Query::Context.
Attributes
Returns
-
GraphQL::Queryβ The query that was executed
Returns
-
Hashβ The resulting hash of βdataβ and/or βerrorsβ
Public Class Methods
Source
# File lib/graphql/query/result.rb, line 12 def initialize(query:, values:) @query = query @to_h = values end
Public Instance Methods
Source
# File lib/graphql/query/result.rb, line 61 def ==(other) case other when Hash @to_h == other when Query::Result @to_h == other.to_h else super end end
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
Resultwhose value matchesresult.to_h
(The query is ignored for comparing result equality.)
Returns
-
Boolean
Calls superclass method
Source
# File lib/graphql/query/result.rb, line 44 def inspect "#<GraphQL::Query::Result @query=... @to_h=#{@to_h}>" end
# File lib/graphql/query/result.rb, line 32 def method_missing(method_name, *args, &block) if @to_h.respond_to?(method_name) @to_h.public_send(method_name, *args, &block) else super end end
Delegate any hash-like method to the underlying hash.
Calls superclass method
# File lib/graphql/query/result.rb, line 40 def respond_to_missing?(method_name, include_private = false) @to_h.respond_to?(method_name) || super end
Calls superclass method