aws-amplify / aws-amplify/amplify-android
Amplify Datastore (1.35.7)- Add filter to default subscriptions for models
- Dominant language
- Java
- Stars
- 287
- Forks
- 132
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 45
Description
We are using 2 tables in DynamoDB and Appsync Schema created for it.
From our Android app, we are using amplify-datastore v1.35.7 to create subscriptions.
By default, the subscriptions for on_create, on_update and on_delete were created by datastore API for the above 2 models.
The query predicate auto-generated out of Datasyncexpression is only filtering the real-time subscriptions before it gets stored into local datastore (Lets call filtering **AFTER** the real time update is received)
We are looking for a way (API) that can create a subscription that create the filter at the head (Lets call filtering **BEFORE** the real time update is received)
_Example_ :
amplify:aws-api: Requesting subscription: {"query": "subscription OnCreateXXX {\n onCreateXXX {\n _deleted\n _lastChangedAt\n _version\n var1\n var2\n var3\n }\n}\n", "variables": null}
amplify:aws-api: Requesting subscription: {"query": "subscription OnUpdateXXX {\n onUpdateXXX {\n _deleted\n _lastChangedAt\n _version\n var1\n var2\n var3\n }\n}\n", "variables": null}
amplify:aws-api: Requesting subscription: {"query": "subscription OnDeleteXXX {\n onDeleteXXX {\n _deleted\n _lastChangedAt\n _version\n var1\n var2\n var3\n }\n}\n", "variables": null}
Please provide some insight around this.
Contributor guide
Research direction
No repository files or tests are named. Start by tracing the Amplify Datastore entry point that produces the shown onCreate, onUpdate, and onDelete subscription requests, then determine whether server-side filtering is supported. Done should be a clear API decision or implementation path covering all three subscription types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, aws
- Domain
- api, databases, mobile
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100