- Newest
- Most votes
- Most comments
Hello,
This issue usually occurs if the filtering criteria based on groupId is not being applied correctly. As I can see from this documentation(https://docs.amplify.aws/javascript/build-a-backend/graphqlapi/query-data/#filter-list-queries), it looks like the groupId should contain some value and then should be passed inside the variables. For example :
const variables = {
filter: {
// Only receive messages where the "groupId" field is "A"
groupId: { eq: 'A' }
}
};
const sub = client
.graphql({
query: subscriptions.onCreateMedia,
variables
})
.subscribe({
next: ({ data }) => console.log(data),
});
I would suggest you to first try getting the data printing on the console and further use subscribe method and pass "groupId === value.data.onCreateMedia.groupId" in the console statement. Debugging by fetching the data first and applying filtering logic over the groupId would help in identifying the issue and mitigating it. Hence, can you help me in sharing the complete client code used in your project for subscribing based on groupId?
Thank you.
Relevant content
- Accepted Answerasked 2 years ago
- asked a year ago
- asked 5 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated a year ago