Open Phok7 opened 11 months ago
Hi @Phok7 👋 thanks for raising this issue.
Are you only observing this behavior in a mocked api or is it reproducible in a live api?
Hi @chrisbonifacio, in a live api is working fine, only occurs in a mocked api.
@Phok7, thanks for the clarity. Since this is only happening when using the mock api, we'll transfer this issue the category-api
repo for better assistance.
Subscriptions runtime filtering is not supported in mock env. (I see that this isn't called out in docs, trying to get it added) Marking this as feature request.
Before opening, please confirm:
JavaScript Framework
Angular
Amplify APIs
GraphQL API
Amplify Categories
api
Environment information
Describe the bug
Hello! I'm running an Amplify project locally with the
amplify mock
command and having some issues.I have the next model:
That have a hasMany relation with this other model:
In the frontend, when I try to subscribe to a new StatusNode created (but only for a specific Node) by the subscrption generated by Amplify:
The subscription failed with the error:
'Connection failed: {"errors":[{"message":"Unable to convert $extensions.setSubscriptionFilter($util.transform.toSubscriptionFilter($ctx.args.filter))\\nnull\\n to class com.amazonaws.deepdish.transform.model.lambda.LambdaVersionedConfig.","errorType":"MappingTemplate","data":null,"errorInfo":null,"path":["onCreateStatusNode"],"locations":[{"line":2,"column":3,"sourceName":"GraphQL request"}]}],"data":{"onCreateStatusNode":null}}'
The response VTL template where the error is going on is:
If I quit the filter argument of the OnCreateStatusNodeListener(), the subscription listener works fine, but when I try to filter by nodeID, the subscription fail.
I have no idea why, but is obviously that the filtering is not apllying propertly in the template engine or something similar.
Can anyone help me with that? Tahnks!
Expected behavior
The expected behavoir is to subscribe to new events filtered by the field, in my cases the nodeID field.
Reproduction steps
amplify init
amplify mock
Code Snippet
Log output
aws-exports.js
Manual configuration
No response
Additional configuration
No response
Mobile Device
No response
Mobile Operating System
No response
Mobile Browser
No response
Mobile Browser Version
No response
Additional information and screenshots
No response