GraphQL: Expose current user todos for todoables
What does this MR do?
This MR introduces a new CurrentUserTodos
GraphQL interface that can be added to "todoables" to expose todos for the current_user
on the object.
The field will return all todos, but accepts an optional state
argument of an existing TodoStateEnum
value (pending
or done
).
The specific use-case is #198439 (closed) where we want to discover a user's todo on a Design when querying for it, allowing the user to mark the todo as done using the existing todoMarkDone
mutation.
The interface has been added to DesignType
, IssueType
, MergeRequestType
and EpicType
.
It hasn't been added to CommitType
as the lookup for a todo on a Commit
differs from the other "todoables". This could be implemented separately when required.
Example
{
project(fullPath: <full-path>) {
issue(iid: <iid>) {
currentUserTodos(state: pending) {
nodes {
id
}
}
}
}
}
- Issue: #198439 (closed)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Edited by Luke Duncalfe