2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
module Types
|
|
|
|
class BaseField < GraphQL::Schema::Field
|
|
|
|
prepend Gitlab::Graphql::Authorize
|
2019-05-18 00:54:41 +05:30
|
|
|
|
|
|
|
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
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|
|
|
|
end
|