I have an Amplify application, using a DynamoDB table with ~50 items and accessing it via a React app.
The initial (simplified) model:
type Video @model
@key(name: "ByOrganization", fields: ["videoOrganizationId", "id"], queryField: "videosByOrganization")
{
id: ID!
createdAt: AWSDateTime
title: String!
season: Int
episode: Int
owner: String
editor: String
organization: Organization @connection
videoOrganizationId: ID
}
on the code I call this query on an Apollo React component:
<Query
query={query}
variables={{
{
limit: 100,
},
}}
pollInterval={5000}
>
{children}
</Query>);
The limit of 100 items should be enough to bring all items from the database, however, it is not what happens, and it limit it to a number of items (~20-30 items)
I have tried adding different indexes to the table:
@key(name: "ByOrganizationSortedByCreated", fields: ["videoOrganizationId", "createdAt"], queryField: "videosByOrganizationSortedByCreated")
@key(name: "ByOrganizationSortedByTitle", fields: ["videoOrganizationId", "title"], queryField: "videosByOrganizationSortedByTitle")
@key(name: "ByOrganizationSortedByTitleSeasonEpisode", fields: ["videoOrganizationId", "title", "season", "episode"], queryField: "videosByOrganizationSortedByTitleSeasonEpisode")
None of them have worked Some items that clearly should be returned on my query are left behind
I also was trying to find any reference about limitatinos on DynamoDb number of returned items, or some odd behaviour that I'm not aware of... no success
There is also some super weird behaviours
ie: if I just add a sortDirection: 'DESC'
, it returns less results!
Does anyone has any idea why is this happening?