#✅ - adding Appsync subscription filter

1 messages · Page 1 of 1 (latest)

tawdry plover
#

Hia
can someone help me on aws appsync
my requirement is .. client can subscribe with game id and multiple market id like
subscribeGameWithMarket(id: Int!, marketIds: [String!]): EventDataTestthe
@aws_subscribe(mutations: ["sendGameWithMarket"])
if game id and one market id match then mutation called
type Mutation {
sendGameWithMarket(input: EventDataInputTest!): EventDataTest
}
input EventDataInputTest {
id: Int
marketIds: [String!]
name: String
}
type EventDataTest {
id: Int
marketIds: [String!]
name: String
}
manishc37 — Today at 4:27 PM
how to add filter if one a et id matches among market list
any lead will be appreciatedthe

#

adding Appsync subscription filter

opal bone
#

const subscription = API.graphql(
graphqlOperation(onCreatePost, { filter: { marketIds: { contains: '1001' } })
).subscribe({
next: (postData) => {
console.log('New post created:', postData);
// Handle the new post data here
},
error: (error) => {
console.error('Error subscribing to post creation:', error);
// Handle the subscription error here
},
});

inland axleBOT
#

✅ - adding Appsync subscription filter