Add a connection base for non-Node relation types
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
strawberry's Connection and Edge generics bind their node type variable to Node, so a connection of a relation type (an object that is not a Node) fails type checking. Add Connection and Edge bases in api/gql that are not bound to Node, with a cursor built from the row key (the surrogate key, or the primary key columns when there is none), following the Relations rules in src/ai/backend/manager/api/gql/AGENTS.md.
## Success Criteria
- [ ] a relation type connection passes pants check
- [ ] a cursor over a composite primary key round-trips through the cursor condition factory
- [ ] the cursor-mode total count is correct for a searcher that joins another table
- [ ] pants test passes for affected packages
JIRA Issue: BA-7887
Contributor guide
Research direction
Start with src/ai/backend/manager/api/gql/AGENTS.md and the existing connection, edge, and cursor condition factory code under api/gql. Trace how relation row keys, surrogate keys, and composite primary keys are handled, then verify the listed cursor round-trip and joined-searcher count criteria with pants check and pants test for affected packages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100