Sha256: 184a5c33b1384664128698c38ab201902aed3fab2dfd18b0feb0b09fb10c4d37

Contents?: true

Size: 586 Bytes

Versions: 4

Compression:

Stored size: 586 Bytes

Contents

require_relative "execution_strategy"

module GraphQL::Batch
  class MutationExecutionStrategy < GraphQL::Batch::ExecutionStrategy
    attr_accessor :enable_batching

    class FieldResolution < GraphQL::Batch::ExecutionStrategy::FieldResolution
      def get_finished_value(raw_value)
        strategy = execution_context.strategy
        return super if strategy.enable_batching

        begin
          strategy.enable_batching = true
          strategy.deep_sync(Promise.sync(super))
        ensure
          strategy.enable_batching = false
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
graphql-batch-0.3.4 lib/graphql/batch/mutation_execution_strategy.rb
graphql-batch-0.3.3 lib/graphql/batch/mutation_execution_strategy.rb
graphql-batch-0.3.2 lib/graphql/batch/mutation_execution_strategy.rb
graphql-batch-0.3.1 lib/graphql/batch/mutation_execution_strategy.rb