Class: GraphQL::Batch::SetupMultiplex

Inherits:
Object
  • Object
show all
Defined in:
lib/graphql/batch/setup_multiplex.rb

Defined Under Namespace

Modules: Trace

Instance Method Summary collapse

Constructor Details

#initialize(schema, executor_class:) ⇒ SetupMultiplex

Returns a new instance of SetupMultiplex.



3
4
5
6
# File 'lib/graphql/batch/setup_multiplex.rb', line 3

def initialize(schema, executor_class:)
  @schema = schema
  @executor_class = executor_class
end

Instance Method Details

#after_multiplex(multiplex) ⇒ Object



12
13
14
# File 'lib/graphql/batch/setup_multiplex.rb', line 12

def after_multiplex(multiplex)
  GraphQL::Batch::Executor.end_batch
end

#before_multiplex(multiplex) ⇒ Object



8
9
10
# File 'lib/graphql/batch/setup_multiplex.rb', line 8

def before_multiplex(multiplex)
  GraphQL::Batch::Executor.start_batch(@executor_class)
end