Commit 0d6655c0 authored by Alex Kalderimis's avatar Alex Kalderimis

Parse GlobalID types prefixed with EE as if not prefixed

parent 07c16be9
...@@ -48,6 +48,13 @@ class GitlabSchema < GraphQL::Schema ...@@ -48,6 +48,13 @@ class GitlabSchema < GraphQL::Schema
super(query_str, **kwargs) super(query_str, **kwargs)
end end
def get_type(type_name)
# This is a backwards compatibility hack to work around an accidentally
# released argument typed as EEIterationID
type_name = type_name.gsub(/^EE/, '') if type_name.end_with?('ID')
super(type_name)
end
def id_from_object(object, _type = nil, _ctx = nil) def id_from_object(object, _type = nil, _ctx = nil)
unless object.respond_to?(:to_global_id) unless object.respond_to?(:to_global_id)
# This is an error in our schema and needs to be solved. So raise a # This is an error in our schema and needs to be solved. So raise a
...@@ -144,6 +151,13 @@ class GitlabSchema < GraphQL::Schema ...@@ -144,6 +151,13 @@ class GitlabSchema < GraphQL::Schema
end end
end end
end end
# This is a backwards compatibility hack to work around an accidentally
# released argument typed as EE{Type}ID
def get_type(type_name)
type_name = type_name.gsub(/^EE/, '') if type_name.end_with?('ID')
super(type_name)
end
end end
GitlabSchema.prepend_if_ee('EE::GitlabSchema') # rubocop: disable Cop/InjectEnterpriseEditionModule GitlabSchema.prepend_if_ee('EE::GitlabSchema') # rubocop: disable Cop/InjectEnterpriseEditionModule
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment