Skip to content

Add group.workItem query to GraphQL API

Mario Celi requested to merge 424662-fetch-single-group-work-item into master

What does this MR do and why?

New field allows to fetch a single work item associated with a group by specifying it's IID in the group. Feature behind the namespace_level_work_items feature flag.

How to set up and validate locally

  1. Enable the feature flag in Rails console Feature.enable(:namespace_level_work_items)
  2. Create a group level work item with the following query at http://127.0.0.1:3000/-/graphql-explorer so you can fetch a work item in the next query
    mutation {
       workItemCreate(input: {namespacePath: "flightjs", title: "test group level work item", workItemTypeId: "gid://gitlab/WorkItems::Type/1"}) {
         errors
         workItem {
           id
           iid
         }
       }
     }
  3. Fetch a wok item by IID
    {
       group(fullPath: "flightjs") {
         name
         workItem(iid: "<iid_returned_in_previus_mutation>") {
           nodes {
             id
             iid
             title
           }
         }
       }
     }

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #424662 (closed)

Edited by Mario Celi

Merge request reports

Loading