aws-appsync-community icon indicating copy to clipboard operation
aws-appsync-community copied to clipboard

Appsync subscription filtering via websocket + postman

Open japatki opened this issue 3 years ago • 2 comments

I'm trying to figure out a way to filter appsync subscriptions.

Thanks, to Sunac's answer here: https://github.com/aws/aws-appsync-community/issues/195 , i was able to subscribe to the websocket url.

Also, with the help of below payload, im able to listen to mutations :

{ "id": "some random uuid", "payload": { "data": "{"query":"subscription MySubscription {\n onCreate {\n someId \n anotherId \n }\n }","variables":{}}", "extensions": { "authorization": { "x-api-key": "some key", "host": "appsync-host-at-amazon.com" } } }, "type": "start" }

I'm looking for a way to put a filter on the subscription though. I was able to do the same on aws appsync console, but cannot achieve it on postman..

Thanks !

japatki avatar Dec 21 '21 08:12 japatki

Hey, to filter, you should look at using subscription arguments in your query. see here for examples: https://docs.aws.amazon.com/appsync/latest/devguide/aws-appsync-real-time-data.html#using-subscription-arguments

onlybakam avatar Feb 07 '22 22:02 onlybakam

True, but that doesn't seem to be working in my payload in Postman.. i believe the same syntax won't work there..

japatki avatar Feb 08 '22 05:02 japatki