summaryrefslogtreecommitdiff
path: root/app/graphql/resolvers/base_resolver.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2019-01-31 03:00:30 +0800
committerLin Jen-Shin <godfat@godfat.org>2019-02-14 15:52:17 +0800
commit91e9e50a1153021257abaa528498d7a82cc3350f (patch)
tree654dd11658da179f0bd4bd0eea5e4d63718c99b1 /app/graphql/resolvers/base_resolver.rb
parent1322146bbf5c76403db10969f1af6540717b1cdf (diff)
downloadgitlab-ce-91e9e50a1153021257abaa528498d7a82cc3350f.tar.gz
Add field mergeRequests for project in GraphQL
And fix the tests so that it won't run into circular paths.
Diffstat (limited to 'app/graphql/resolvers/base_resolver.rb')
-rw-r--r--app/graphql/resolvers/base_resolver.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/graphql/resolvers/base_resolver.rb b/app/graphql/resolvers/base_resolver.rb
index 459933af9d3..063def75d38 100644
--- a/app/graphql/resolvers/base_resolver.rb
+++ b/app/graphql/resolvers/base_resolver.rb
@@ -2,5 +2,12 @@
module Resolvers
class BaseResolver < GraphQL::Schema::Resolver
+ def self.single
+ @single ||= Class.new(self) do
+ def resolve(**args)
+ super.first
+ end
+ end
+ end
end
end