Data Sync SDK for Native Android and iOS


The Data Sync feature for the Android and iOS SDKs is satisfied by community supported Apollo GraphQL clients. Clients provide range of features

  • Query Pulling capabilities

  • Real time data synchronization using subscriptions

  • Offline storage using cache

  • Initializing offline data

Limitations

What is not supported out of the box is an data edits (mutations). Developers can detect network errors in their apps and let user manualy reattempt by sending them later.

Both IOS and Android provide offline database that is read only.when offline and can be synced by subscriptions. Frameworks do not offer data difference information but developers can get that by utilizing debezium - or any event queue that will persist history of changes.

General information for GraphQL can be found here: https://www.howtographql.com/

Features

Query

Communicating with the GraphQL server starts with creating and configuring the Apollo client. This is accomplished by using the Apollo client for Android and iOS.

  • Android

  • iOS

Performing queries against the custom GraphQL schema requires the use of an Android Apollo client object. Information on how to use the Apollo client is at https://www.apollographql.com/docs/android/essentials/queries/
Example app: https://github.com/apollographql/frontpage-ios-app
Performing queries against the custom GraphQL schema requires the use of an Apollo client object. Information on how to use the Apollo client is at https://www.apollographql.com/docs/ios/fetching-queries/

Mutations

Mutating data (CRUD operations) against the custom GraphQL schema.

  • Android

  • iOS

Inserting, modifying, and deleting data (mutations) against the custom GraphQL schema requires the use of an android Apollo client object. Information on how to use the Apollo client to query data is at https://www.apollographql.com/docs/android/essentials/mutations/
Inserting, modifying, and deleting data (mutations) against the custom GraphQL schema requires the use of an Android Apollo client object. Information on how to use the Apollo client for mutations is at https://www.apollographql.com/docs/ios/mutations/

File Upload

The Apollo client can also be used to upload file from a mobile Android and iOS device.

  • Android

  • iOS

Uploding files from a mobile client against the custom GraphQL schema requires the use of an Android Apollo client object. Information on how to use the Apollo client to upload files is at https://github.com/apollographql/apollo-android#support-file-upload
Uploding files from a mobile client against the custom GraphQL schema requires the use of an iOS Apollo client object. Information on how to use the Apollo client to upload is at https://www.apollographql.com/docs/ios/

Realtime Updates

The Apollo GraphQL clients support realtime updates, however, these features are not widely documented in the official documentation

  • Android

  • iOS

Apollo GraphQL supports subscriptions to realtime updates. Information on how to use the Apollo client for subscriptions is https://medium.com/@abody/apollo-graphql-and-kotlin-create-a-back-to-back-subscription-system-860b51389179

Apollo GraphQL supports subscriptions to realtime updates. Information on how to use the Apollo client to subscribe for data is at https://stackoverflow.com/questions/51720378/how-to-implement-graphql-subscription-using-apollo-ios-client


Additional Information

  1. Client SDK information: https://blog.apollographql.com/one-graphql-client-for-javascript-ios-and-android-64993c1b7991

  2. Information on the Apollo GraphQL client for android can be found here: appollo client for android.

  3. Red Hat Product extensions for GraphQL https://github.com/aerogear/graphql-home