Amplify-cli: Add support for passing parameter when running subscription in Angular service

Created on 10 Oct 2019  路  8Comments  路  Source: aws-amplify/amplify-cli

Since authorized subscriptions should work by now, following a few tickets #504, #1021, #1766, #1810.
I don't understand how I can use that subscriptions now with the generated JavaScript client. How can I pass the owner to the subscription?

type Todo @model @auth(rules: [{allow: owner}]){
  id: ID!
  title: String!
  owner: String
}
this.apiService.OnCreateTodoListener.subscribe((evt) => {
      console.log("added: ", evt);
});
bug code-gen

Most helpful comment

You can use this workaround for the time being adapting it for your current use case
https://gist.github.com/gsans/aeffbae886add35b669c84f5e5b3fa69#file-postcomments-component-ts-L27-L43

All 8 comments

Hey @mattmeye, a PR would be welcome!

Hi @mattmeye is there any bugfix or work around yet? Thx

You can use this workaround for the time being adapting it for your current use case
https://gist.github.com/gsans/aeffbae886add35b669c84f5e5b3fa69#file-postcomments-component-ts-L27-L43

Hi there, any update ?
@nikhname ?

Any update?

Any update or is this another dead end?

HI,
Same issue here.
Any update ?

Was this page helpful?
0 / 5 - 0 ratings