[BE] Return custom work item types through the types provider in GraphQL
Followup based on this discussion
Thank you for working on this @daniyalAD
🙇 I checkout this out in my gdk and I could finally see the new CWIT is createdThat's so exciting I just wanted to know that how if the
namespaceWorkItemTypesquery should return the created WIT ? Because I could not see it when I fetched it again🤔 If not , which backend issue would target it ?
Summary
Update the TypesFramework::Provider to return custom work item types in the namespaceWorkItemTypes GraphQL query, similar to how system defined types are handled.
Context
- Discussion originated from: !223304 (merged) (comment)
- Related MR for system defined types: !223538 (merged)
- Related issue for creating custom types: #581937 (closed)
- Parent epic: &19883
Currently, when a custom work item type (CWIT) is created via the workItemTypeCreate mutation, it is not returned by the namespaceWorkItemTypes query. This is because the TypesFramework::Provider only returns system-defined types.
Technical Details
The following files are relevant for incorporating custom work item types in graphQL:
| File | Purpose |
|---|---|
app/graphql/resolvers/work_items/types_resolver.rb |
GraphQL Resolver - Uses WorkItems::TypesFinder to fetch types |
app/finders/work_items/types_finder.rb |
Finder - Uses TypesFramework::Provider to get types |
app/models/work_items/types_framework/provider.rb |
Provider (main logic) - all_ordered_by_name method is the entry point for fetching all work item types |
app/models/work_items/types_filter.rb |
Filter - allowed_types method filters which types are available |
Implementation Approach
The Provider class at app/models/work_items/types_framework/provider.rb is the single source of truth. It currently returns system-defined types but needs to be updated to also include custom types from WorkItems::TypesFramework::Custom::Type.
Follow a similar approach to !223538 (merged) (incorporating system defined types into the types provider) to add custom work item types.
Acceptance Criteria
-
Custom work item types created via
workItemTypeCreatemutation are returned bynamespaceWorkItemTypesquery - Custom types are properly filtered based on namespace context
- Existing system-defined types behavior is preserved