summaryrefslogtreecommitdiff
path: root/app/graphql/types/mutation_operation_mode_enum.rb
blob: 08214eebc7ea1d0d55eb941d4b36f24bc198423c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Types
  class MutationOperationModeEnum < BaseEnum
    graphql_name 'MutationOperationMode'
    description 'Different toggles for changing mutator behavior'

    # Suggested param name for the enum: `operation_mode`

    value 'REPLACE', 'Performs a replace operation.'
    value 'APPEND', 'Performs an append operation.'
    value 'REMOVE', 'Performs a removal operation.'

    def self.default_mode
      enum[:replace]
    end

    def self.transform_modes
      enum.values_at(:remove, :append)
    end
  end
end