summaryrefslogtreecommitdiff
path: root/app/graphql/types/base_field.rb
blob: 8c8b8a82d3eef281228aa03157a400b995cded36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# frozen_string_literal: true

module Types
  class BaseField < GraphQL::Schema::Field
    prepend Gitlab::Graphql::Authorize

    DEFAULT_COMPLEXITY = 1

    def initialize(*args, **kwargs, &block)
      # complexity is already defaulted to 1, but let's make it explicit
      kwargs[:complexity] ||= DEFAULT_COMPLEXITY

      super(*args, **kwargs, &block)
    end
  end
end