Module: Gitlab::Graphql::DeprecationsBase::ClassMethods

Defined in:
lib/gitlab/graphql/deprecations_base.rb

Instance Method Summary collapse

Instance Method Details

#apply_to_graphql_name(graphql_name) ⇒ Object

Returns the new ‘graphql_name` (Type#graphql_name) of a deprecated GID, or the `graphql_name` argument given if no deprecation applies.



34
35
36
37
38
# File 'lib/gitlab/graphql/deprecations_base.rb', line 34

def apply_to_graphql_name(graphql_name)
  return graphql_name unless deprecation = self::OLD_GRAPHQL_NAME_MAP[graphql_name]

  self.map_graphql_name(deprecation.new_name)
end

#deprecated?(old_name) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/gitlab/graphql/deprecations_base.rb', line 20

def deprecated?(old_name)
  self::OLD_NAME_MAP.key?(old_name)
end

#deprecation_by(new_name) ⇒ Object



28
29
30
# File 'lib/gitlab/graphql/deprecations_base.rb', line 28

def deprecation_by(new_name)
  self::NEW_NAME_MAP[new_name]
end

#deprecation_for(old_name) ⇒ Object



24
25
26
# File 'lib/gitlab/graphql/deprecations_base.rb', line 24

def deprecation_for(old_name)
  self::OLD_NAME_MAP[old_name]
end