Skip to content

Update docs for result return type #4984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.3
bundler-cache: true
- run: bundle exec rake compile
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.3
bundler-cache: true
env:
BUNDLE_GEMFILE: ./spec/dummy/Gemfile
Expand Down
2 changes: 1 addition & 1 deletion lib/graphql/execution/interpreter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class << self
# @param queries [Array<GraphQL::Query, Hash>]
# @param context [Hash]
# @param max_complexity [Integer, nil]
# @return [Array<Hash>] One result per query
# @return [Array<GraphQL::Query::Result>] One result per query
def run_all(schema, query_options, context: {}, max_complexity: schema.max_complexity)
queries = query_options.map do |opts|
case opts
Expand Down
2 changes: 1 addition & 1 deletion lib/graphql/query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def operations
end

# Get the result for this query, executing it once
# @return [Hash] A GraphQL response, with `"data"` and/or `"errors"` keys
# @return [GraphQL::Query::Result] A Hash-like GraphQL response, with `"data"` and/or `"errors"` keys
def result
if !@executed
Execution::Interpreter.run_all(@schema, [self], context: @context)
Expand Down
4 changes: 2 additions & 2 deletions lib/graphql/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ def sanitized_printer(new_sanitized_printer = nil)

# Execute a query on itself.
# @see {Query#initialize} for arguments.
# @return [Hash] query result, ready to be serialized as JSON
# @return [GraphQL::Query::Result] query result, ready to be serialized as JSON
def execute(query_str = nil, **kwargs)
if query_str
kwargs[:query] = query_str
Expand Down Expand Up @@ -1323,7 +1323,7 @@ def execute(query_str = nil, **kwargs)
# @see {Execution::Multiplex#run_all} for multiplex keyword arguments
# @param queries [Array<Hash>] Keyword arguments for each query
# @param context [Hash] Multiplex-level context
# @return [Array<Hash>] One result for each query in the input
# @return [Array<GraphQL::Query::Result>] One result for each query in the input
def multiplex(queries, **kwargs)
GraphQL::Execution::Interpreter.run_all(self, queries, **kwargs)
end
Expand Down