AWS uses a helper for both subscriptions and mutations that can be seen here: https://github.com/awslabs/aws-mobile-appsync-sdk-js/blob/7001bc1c55118453ced6a7fbd1d3c6fbbe6e6b72/packages/aws-appsync/src/helpers/offline.ts 1. This api can detect type of operation by name 2. It will then provide corresponding update function While api provides comprehensive CRUD updates it is still kinda rough for various use cases: https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/349 https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/364 I think we should start with something much more up to date with Apollo 2.5 by:
- Getting the Add, Delete cache operations explicitly
- Do not handle updates (as they are handled out of the box)
- Start with helper for mutations
- Incorporate helper and optimistic response into new method available in Apollo client
ping Stephen Coady Dara Hayes |