#✅ - Amplify Gen2 Subscriptions returns blank result

5 messages · Page 1 of 1 (latest)

midnight willow
#

Using Amplify Gen2 subscriptions I am able to obtain all data of a specific model but any new items created via AppSync through console triggers a subscription event in my app but no object data is sent along with the trigger. This applied to both client.models.(model).onCreate and client.models.(model).observeQuery().subscribe.

Data returned in console is:

New item:
Object { }

<prototype>: Object { … }

The "Object { items: (11) […], isSynced: true }" in attached image is a successful fetch on application initialization.

I am using Angular. Am I doing something wrong?

nova narwhal
#

Hi @midnight willow are you setting a selection set on the client request? Usually if a subscription triggers with no data, it might be caused by mismatching selection sets between the mutation and the subscription

#

you can also check the selection set in the request payload by inspecting the page > Network tab > check the graphql request > Payload

#

if the selection sets are the same between the two, please open an issue on the amplify-js repo with the details of your schema and amplify api client configuration and code snippets for us to reproduce the issue

https://github.com/aws-amplify/amplify-js/issues

azure mulchBOT
#

✅ - Amplify Gen2 Subscriptions returns blank result