aws / aws/aws-appsync-community
Issue : Enhanced filtering in subscriptions return nothing after 100 records created
- Dominant language
- HTML
- Stars
- 507
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
I have been struggling with this issue, and found no solution of this
Here is my Schema
```
type Message
@model(subscriptions: null)
@versioned
@aws_iam
@aws_cognito_user_pools
@key(name: "messageByConversation", fields: ["conversationId", "createdAt"] queryField:"getMessagesByConversationID")
# used to get all the messages for a conversation.
@auth(
rules: [
{ allow: private, provider: iam }
]
)
{
id: ID!
content: String!
senderInfo: PersonInfo!
conversationId: ID! # a message can only belong to one conversation. 1:1 relationship
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
isRead: Boolean!
readBy: [PersonInfo]
conversation: Conversation @connection(fields: ["conversationId"])
}
```
Mutation
```
mutation CreateMessage(
$input: CreateMessageInput!
$condition: ModelMessageConditionInput
) {
createMessage(input: $input, condition: $condition) {
id
content
# more fields are there
.
.
.
}
```
And here is my subscription
```
onCreateMessage(conversationId: ID!): Message @aws_subscribe(mutations: ["createMessage"])
```
Issue:
When creating a message with createMessage mutation, the subscription will return Message if it belongs to input conversationId, but when there are 100 Messages in the db with that conversationId it stops returning Message when createMessage mutation is called, but if I did not provide any filter it works fine.
Does any one know how to solve this issue, or is there any limitation in subscriptions with filter
Contributor guide
Research direction
Start by reproducing the createMessage mutation with the shown Message schema and the onCreateMessage subscription, comparing filtered and unfiltered behavior after 100 messages share a conversationId. Check the AWS AppSync subscription filtering and pagination limitations; done means identifying the cause and documenting a verified workaround or limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, graphql
- Domain
- api
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100