aws / aws/aws-appsync-community
How to determine if there are active subscriptions?
- Dominant language
- HTML
- Stars
- 507
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
We want to display the current state of our IoT devices in our Angular front-end, connected via AppSync subscriptions. When we get a device shadow update from our devices via IoT Core we use a Lambda to call a mutation in AppSync with a local resolver. This publishes notifications to any subscribers, which triggers a front-end update. That's all good.
However this does mean that sometimes our Lambda is calling mutations in AppSync when there are no subscribers to be notified, either because there are no clients connected at that time, or because the connected clients are not displaying data from that particular IoT device. We really don't want to do this at scale, as it would be quite expensive.
What would be great is a way for the Lambda to get AppSync to confirm whether there is a subscription for a particular mutation and IoT device prior to calling the mutation. Is there a way to do this?
Contributor guide
Research direction
Start by reviewing the Lambda-to-AppSync mutation flow, the AppSync local resolver, and the IoT Core shadow update path described in the issue. Determine whether AppSync exposes subscription presence for a particular mutation and device; done means documenting a supported approach or confirming that this is not available.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, aws, graphql
- Domain
- api, backend, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100