Add ability to get epic by ID in GraphQL
In the issues list filtered search bar, we can filter by epic. For the epic token to work, we need to be able to:
- Search epics and show the results in the suggestions list
- Get an epic by ID so we can show the epic title in the filtered search bar (this is necessary when we get the epic ID from the URL parameter (e.g.
epic_id=17
)
We can do 1. by:
{
group(fullPath: "gitlab-org") {
epics(search: "pajamas", in: [TITLE]) {
nodes {
id
title
}
}
}
}
However, we can't do 2., so we need to add the ability to get an epic by ID.
Proposal
We could add the ability to get an epic by ID with a query like the following:
// proposal to get an epic by ID
query {
epic(id:"gid://gitlab/Epic/17") {
id
title
}
}
This is similar to how we can currently get an iteration by ID:
// we can currently get an iteration by ID
query {
iteration(id:"gid://gitlab/Iteration/17") {
id
title
}
}
Acceptance criteria
- You can get a single epic by ID via GraphQL