summaryrefslogtreecommitdiff
path: root/lib/gitlab/graphql/present/instrumentation.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/graphql/present/instrumentation.rb')
-rw-r--r--lib/gitlab/graphql/present/instrumentation.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/graphql/present/instrumentation.rb b/lib/gitlab/graphql/present/instrumentation.rb
index ab03c40c22d..941a4f434a1 100644
--- a/lib/gitlab/graphql/present/instrumentation.rb
+++ b/lib/gitlab/graphql/present/instrumentation.rb
@@ -23,7 +23,9 @@ module Gitlab
end
presenter = presented_in.presenter_class.new(object, **context.to_h)
- wrapped = presented_type.class.new(presenter, context)
+
+ # we have to use the new `authorized_new` method, as `new` is protected
+ wrapped = presented_type.class.authorized_new(presenter, context)
old_resolver.call(wrapped, args, context)
end