Method: GraphQL::Query#result

Defined in:
lib/graphql/query.rb

#resultHash

Get the result for this query, executing it once

Returns:

  • (Hash)

    A GraphQL response, with "data" and/or "errors" keys



157
158
159
160
161
162
163
164
# File 'lib/graphql/query.rb', line 157

def result
  if !@executed
    with_prepared_ast {
      Execution::Multiplex.run_queries(@schema, [self])
    }
  end
  @result ||= Query::Result.new(query: self, values: @result_values)
end