diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 13:18:24 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 13:18:24 +0000 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/graphql/resolvers/todo_resolver.rb | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) | |
download | gitlab-ce-14.3.0-rc42.tar.gz |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/graphql/resolvers/todo_resolver.rb')
-rw-r--r-- | app/graphql/resolvers/todo_resolver.rb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/app/graphql/resolvers/todo_resolver.rb b/app/graphql/resolvers/todo_resolver.rb index 263b190c74e..f0be1b6e9a5 100644 --- a/app/graphql/resolvers/todo_resolver.rb +++ b/app/graphql/resolvers/todo_resolver.rb @@ -8,27 +8,34 @@ module Resolvers argument :action, [Types::TodoActionEnum], required: false, - description: 'The action to be filtered.' + description: 'Action to be filtered.' argument :author_id, [GraphQL::Types::ID], required: false, - description: 'The ID of an author.' + description: 'ID of an author.' argument :project_id, [GraphQL::Types::ID], required: false, - description: 'The ID of a project.' + description: 'ID of a project.' argument :group_id, [GraphQL::Types::ID], required: false, - description: 'The ID of a group.' + description: 'ID of a group.' argument :state, [Types::TodoStateEnum], required: false, - description: 'The state of the todo.' + description: 'State of the todo.' argument :type, [Types::TodoTargetEnum], required: false, - description: 'The type of the todo.' + description: 'Type of the todo.' + + before_connection_authorization do |nodes, current_user| + Preloaders::UserMaxAccessLevelInProjectsPreloader.new( + nodes.map(&:project).compact, + current_user + ).execute + end def resolve(**args) return Todo.none unless current_user.present? && target.present? |