aws / aws/aws-appsync-community

How to determine if there are active subscriptions?

Open
#129 11 comments 0 reactions 0 assignees View on GitHub
feature-request
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.