How to subscribe Create and Delete with <Connect />
See original GitHub issue** Which Category is your question related to? ** API / GraphQL
** What AWS Services are you utilizing? ** AWS AppSync
** Provide additional details e.g. code snippets ** Hello all,
I’m trying to subscribe any updates including create, delete and update in my GraphQL backend using <Connect />
, but all I could find from Amplify API doc was just an example which is subscribing Create events only like following.
<Connect
query={graphqlOperation(queries.listTodos)}
subscription={graphqlOperation(subscriptions.onCreateTodo)}
onSubscriptionMsg={(prev, { onCreateTodo }) => {
console.log ( onCreateTodo );
return prev;
}}
>
Anyone know how to subscribe create and delete at the same time with <Connect />
?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:16
Top Results From Across the Web
Delete a Pull Subscription - SQL Server - Microsoft Learn
Right-click the subscription, and then click Delete. In the confirmation dialog box, select whether to connect to the Subscriber to delete ...
Read more >How to delete and create a new path in a workflow - ServiceNow
Clicking the "delete" completely removes the link node (see the "Notification" stage below). Deep K's answer is what I was looking for. What ......
Read more >How do I delete or remove a calendar subscriber?
On the calendar page, scroll down to the subscriber's section. Locate the "All subscribers" button on the bottom right and click the button....
Read more >Deleting an Amazon SNS subscription and topic
On the Subscriptions page, select a subscription with a Status of Confirmed, and then choose Delete. In the Delete subscription dialog box, choose...
Read more >Delete an account – curl - Stripe API reference
Delete an account. With Connect, you can delete accounts you manage. Accounts created using test-mode keys can be deleted at any time.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I just realized I misread your post (sorry, busy day). So my other post may not answer your question, but maybe this will: you’ll have to use a custom subscription. For example, amplify probably creates something like this in a subscriptions.js file:
And then you can only select onCreatePost OR onDeletePost
But you could create a new subscription in a custom file:
I think that’ll work, worth a quick try at least.
There may be a more elegant way of doing this without doing a custom subscription.js file, but I don’t know it.
This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server
*-help
channels or Discussions for those types of questions.