Return Custom::Type from GraphQL on creation
Issue: [BE] Follow-up: Return Custom::Type from Graph... (#590845 - closed)
What does this MR do and why?
This change simplifies how custom work item types are handled in the system. Previously, the code was creating wrapper objects and using different internal identifiers for custom types versus system-defined types.
Now, custom work item types are treated more consistently with the existing system types - they use the same naming conventions and return the same type of identifiers when referenced.
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
-
In rails console, enable the feature flag
Feature.enable(:work_item_configurable_types) -
Test via GraphQL (GraphiQL at /-/graphql-explorer)
Create a custom work item type:
mutation {
workItemTypeCreate(input: {
fullPath: "your-group-path"
name: "My Custom Type"
iconName: "bug"
}) {
workItemType {
id
name
iconName
}
errors
}
}
Verify the response:
- The id field should return a GID like
gid://gitlab/WorkItems::Type/123 - Not
gid://gitlab/WorkItems::TypesFramework::Custom::Type/123
- Verify in rails console
custom_type = WorkItems::TypesFramework::Custom::Type.last
# Check the GID
custom_type.to_global_id.to_s
# Should return: "gid://gitlab/WorkItems::Type/<id>"
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.