summaryrefslogtreecommitdiff
path: root/app/graphql/resolvers/base_resolver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/graphql/resolvers/base_resolver.rb')
-rw-r--r--app/graphql/resolvers/base_resolver.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/graphql/resolvers/base_resolver.rb b/app/graphql/resolvers/base_resolver.rb
index 87a63231b22..539e37db1c2 100644
--- a/app/graphql/resolvers/base_resolver.rb
+++ b/app/graphql/resolvers/base_resolver.rb
@@ -8,6 +8,14 @@ module Resolvers
argument_class ::Types::BaseArgument
+ def self.requires_argument!
+ @requires_argument = true
+ end
+
+ def self.field_options
+ super.merge(requires_argument: @requires_argument)
+ end
+
def self.singular_type
return unless type
@@ -109,6 +117,10 @@ module Resolvers
[args[:iid], args[:iids]].any? ? 0 : 0.01
end
+ def offset_pagination(relation)
+ ::Gitlab::Graphql::Pagination::OffsetActiveRecordRelationConnection.new(relation)
+ end
+
override :object
def object
super.tap do |obj|