Skip to content

Commit

Permalink
explicitly pass arguments instead of using *args
Browse files Browse the repository at this point in the history
  • Loading branch information
Siebe Jan authored and rmosolgo committed Jun 26, 2017
1 parent 59ea249 commit 7267e00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/graphql/execution/multiplex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ def initialize(schema:, queries:, context:)
end

class << self
def run_all(schema, query_options, *rest, max_complexity: nil)
def run_all(schema, query_options, context: {}, max_complexity: nil)
queries = query_options.map { |opts| GraphQL::Query.new(schema, nil, opts) }
run_queries(schema, queries, *rest, max_complexity: max_complexity)
run_queries(schema, queries, context: context, max_complexity: max_complexity)
end

# @param schema [GraphQL::Schema]
Expand Down
4 changes: 2 additions & 2 deletions lib/graphql/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ def execute(query_str = nil, max_complexity: nil, **kwargs)
# @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
def multiplex(*args, max_complexity: nil)
def multiplex(*args, max_complexity: nil, context: {})
with_definition_error_check {
GraphQL::Execution::Multiplex.run_all(self, *args, max_complexity: max_complexity)
GraphQL::Execution::Multiplex.run_all(self, *args, context: context, max_complexity: max_complexity)
}
end

Expand Down

0 comments on commit 7267e00

Please sign in to comment.