diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-14 16:06:53 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@vanlanduyt.co> | 2018-06-15 15:38:32 +0300 |
commit | 9403b1d951c47aca67d2bac1369b86c125c5119d (patch) | |
tree | b87c3d85588b258dceb5c22ff1e855f3c7d48cdf /app/graphql/types | |
parent | d85929d72aa3ffc2e96d12d7b6308d3bf541676c (diff) |
Allow querying a single MR within a project
This allows the user to get a single MR nested in a GraphQL project
query.
Since we need the full path and the iid anyway, this makes more sense
than having a root query that needs the full path as well.
Diffstat (limited to 'app/graphql/types')
-rw-r--r-- | app/graphql/types/project_type.rb | 7 | ||||
-rw-r--r-- | app/graphql/types/query_type.rb | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/app/graphql/types/project_type.rb b/app/graphql/types/project_type.rb index 9e885d5845a..d9058ae7431 100644 --- a/app/graphql/types/project_type.rb +++ b/app/graphql/types/project_type.rb @@ -61,5 +61,12 @@ module Types field :request_access_enabled, GraphQL::BOOLEAN_TYPE, null: true field :only_allow_merge_if_all_discussions_are_resolved, GraphQL::BOOLEAN_TYPE, null: true field :printing_merge_request_link_enabled, GraphQL::BOOLEAN_TYPE, null: true + + field :merge_request, + Types::MergeRequestType, + null: true, + resolver: Resolvers::MergeRequestResolver do + authorize :read_merge_request + end end end diff --git a/app/graphql/types/query_type.rb b/app/graphql/types/query_type.rb index be79c78bf67..010ec2d7942 100644 --- a/app/graphql/types/query_type.rb +++ b/app/graphql/types/query_type.rb @@ -9,13 +9,6 @@ module Types authorize :read_project end - field :merge_request, Types::MergeRequestType, - null: true, - resolver: Resolvers::MergeRequestResolver, - description: "Find a merge request" do - authorize :read_merge_request - end - field :echo, GraphQL::STRING_TYPE, null: false, function: Functions::Echo.new end end |