Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-05-21 10:52:24 +0300
committerBob Van Landuyt <bob@vanlanduyt.co>2018-06-05 21:47:42 +0300
commitaa4b1ae71260720b47695b8a256134f20280f61a (patch)
tree81020f291d634e76fe0a31d906ed73639f634b7d /app/graphql/gitlab_schema.rb
parent287c34ca1f9af4e395493c99623af8437f82d919 (diff)
Add `present_using` to types
By specifying a presenter for the object type, we can keep the logic out of `GitlabSchema`. The presenter gets initialized using the object being presented, and the context (including the `current_user`).
Diffstat (limited to 'app/graphql/gitlab_schema.rb')
-rw-r--r--app/graphql/gitlab_schema.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/graphql/gitlab_schema.rb b/app/graphql/gitlab_schema.rb
index 143ccf92c85..ac75c4bf2e3 100644
--- a/app/graphql/gitlab_schema.rb
+++ b/app/graphql/gitlab_schema.rb
@@ -1,11 +1,12 @@
Gitlab::Graphql::Authorize.register!
+Gitlab::Graphql::Present.register!
GitlabSchema = GraphQL::Schema.define do
use BatchLoader::GraphQL
enable_preloading
enable_authorization
+ enable_presenting
- mutation(Types::MutationType)
query(Types::QueryType)
end