aws-amplify / aws-amplify/amplify-data
Increasing the number of items returned through a relationship
- Dominant language
- TypeScript
- Stars
- 18
- Forks
- 23
- Avg merge
- 26m
- Merged PRs (30d)
- 1
Description
### Describe the feature you'd like to request
In Gen1 we were able to adjust how many items were returned through a @connection by doing something like this: clinics(limit:500) { items { id clinicId } }. There doesn't seem to be a way to do this in Gen 2? I can set the selectionSet params like so: [clinics.*] but there is no param for the limit variable. By default, amplify will only return 100 items which is not enough in certain situations, so I would like a way to increase the limit.
### Describe the solution you'd like
Currently selectionSet is a string array. This can be changed to an object array that looks something like this:
```
selectionSet: {
key: string;
limit?: number;
}[]
```
Or maybe you can add an additional parameter to the options object that selectionSet sits inside of?
### Describe alternatives you've considered
The only alternative I have so far is to run a separate query to get the rest of the items that weren't in the original 100.
### Additional context
_No response_
### Is this something that you'd be interested in working on?
- [ ] 👋 I may be able to implement this feature request
### Would this feature include a breaking change?
- [ ] ⚠️ This feature might incur a breaking change
Contributor guide
Research direction
No files or tests are named; start by locating the Gen 2 TypeScript implementation of selectionSet and relationship fetching, then compare it with the described Gen 1 @connection limit behavior. Done means providing a documented way to configure more than the default 100 related items without requiring a separate query.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100