Sha256: 607265f47bb9d6d1dbc64c55ebebe526670565bbff51ff5741c3f6b8aa3020f3

Contents?: true

Size: 699 Bytes

Versions: 4

Compression:

Stored size: 699 Bytes

Contents

module GraphQL::Batch
  class MutationExecutionStrategy < GraphQL::Query::SerialExecution
    class FieldResolution < GraphQL::Query::SerialExecution::FieldResolution
      def get_finished_value(raw_value)
        raw_value = GraphQL::Batch::Promise.resolve(raw_value).sync

        context = execution_context.query.context
        old_execution_strategy = context.execution_strategy
        begin
          context.execution_strategy = GraphQL::Batch::ExecutionStrategy.new
          result = super(raw_value)
          GraphQL::Batch::Executor.current.wait_all
          result
        ensure
          context.execution_strategy = old_execution_strategy
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
graphql-batch-0.2.4 lib/graphql/batch/mutation_execution_strategy.rb
graphql-batch-0.2.3 lib/graphql/batch/mutation_execution_strategy.rb
graphql-batch-0.2.2 lib/graphql/batch/mutation_execution_strategy.rb
graphql-batch-0.2.1 lib/graphql/batch/mutation_execution_strategy.rb