Allow filtering work items by Key Result type
requested to merge 385084-okr-for-gitlab-add-ability-to-filter-project-work-items-by-type-key-result into master
Related to #385084 (closed)
What does this MR do and why?
Adds the ability to filter work items by type KEY_RESULT
using GraphQL.
How to set up and validate locally
- Enable feature flag in rails console
Feature.enable(:okrs_mvc)
- Visit
http://gdk.test:3000/-/graphql-explorer
and create work items with different types:
create work item mutations
mutation createKeyResult {
workItemCreate(
input: {title: "Key Result 1", projectPath: "gitlab-org/gitlab-test", workItemTypeId: "gid://gitlab/WorkItems::Type/2417"}
) {
workItem {
title
}
errors
}
}
mutation createObjective {
workItemCreate(
input: {title: "Objective 1", projectPath: "gitlab-org/gitlab-test", workItemTypeId: "gid://gitlab/WorkItems::Type/2416"}
) {
workItem {
title
}
errors
}
}
mutation createIssue {
workItemCreate(
input: {title: "Issue 1", projectPath: "gitlab-org/gitlab-test", workItemTypeId: "gid://gitlab/WorkItems::Type/1"}
) {
workItem {
title
}
errors
}
}
- Query the project's work items using the
types
filter:
query keyResults {
project(fullPath: "gitlab-org/gitlab-test") {
workItems(types: KEY_RESULT) {
edges {
node {
title
}
}
}
}
}
- The response should only contain key results
{"data": {"project": {"workItems": {"edges": [{"node": {"title": "Key Result 1"}}]}}}}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Eugenia Grieff