Sha256: 418c5a0c015239544a10988be3fe3dbed0e528c82f7003f476b3739a0c03a3bd

Contents?: true

Size: 878 Bytes

Versions: 7

Compression:

Stored size: 878 Bytes

Contents

# frozen_string_literal: true

module GraphqlDevise
  module MountMethod
    module OptionValidators
      class ProvidedOperationsValidator
        def initialize(options:, supported_operations:)
          @options              = options
          @supported_operations = supported_operations
        end

        def validate!
          supported_keys = @supported_operations.keys

          [
            SupportedOperationsValidator.new(provided_operations: @options.skip, key: :skip, supported_operations: supported_keys),
            SupportedOperationsValidator.new(provided_operations: @options.only, key: :only, supported_operations: supported_keys),
            SupportedOperationsValidator.new(provided_operations: @options.operations.keys, key: :operations, supported_operations: supported_keys)
          ].each(&:validate!)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
graphql_devise-1.4.0 lib/graphql_devise/mount_method/option_validators/provided_operations_validator.rb
graphql_devise-1.3.0 lib/graphql_devise/mount_method/option_validators/provided_operations_validator.rb
graphql_devise-1.2.0 lib/graphql_devise/mount_method/option_validators/provided_operations_validator.rb
graphql_devise-1.1.1 lib/graphql_devise/mount_method/option_validators/provided_operations_validator.rb
graphql_devise-1.1.0 lib/graphql_devise/mount_method/option_validators/provided_operations_validator.rb
graphql_devise-1.0.1 lib/graphql_devise/mount_method/option_validators/provided_operations_validator.rb
graphql_devise-1.0.0 lib/graphql_devise/mount_method/option_validators/provided_operations_validator.rb