aws / aws-appsync-community

The AWS AppSync community
https://aws.amazon.com/appsync
Apache License 2.0
506 stars 32 forks source link

RFC: AppSync Enhanced Enhanced Subscriptions Filtering #291

Open cbaron opened 1 year ago

cbaron commented 1 year ago

The current enhanced subscriptions filtering is great -- thank you AppSync. I feel that the current system is cost prohibitive. Here is my use case.

There is a set of places we monitor. Every minute or so we want to publish information about each space so that subscribers have the option of getting real time information about a space. Upon implementing a mutation for each space every minute or so, we found the cost of making individual requests too high.

We could save money and electricity if we were able to publish this information in batches. The problem with that though is that I cannot use enhanced subscriptions filtering to get one item from a batch.

input Data {
  locationId: Int!
  datum1: Int!
  datum2: Int!
}

type Mutation {
  PublishData(batchId: Int!, data: [Data!]!): PublishDataOutput!
}

type PublishDataOutput {
 batchId: Int!
 data: [Data!]!
}

type Subscription {
  RealtimeData(batchId: Int!, datum1: Int!): PublishDataOutput
    @aws_subscribe(mutations: ["PublishData"])
}

It would be great to be able to have the subscription return a subset of data in the list based on the arguments.