The JS SDK for sync is in progress: https://github.com/wtrocki/offline-conflict-strategies There's an app currently which will eventually become the sdk: https://github.com/wtrocki/offline-conflict-strategies What has to be done for this task is get the device/app info and pass it as headers. Getting the device/app info: https://github.com/aerogear/aerogear-js-sdk/blob/f9783a4ce192f4653a1668aee5fb7c2ebcf69f9f/packages/core/src/metrics/platform/CordovaDeviceMetrics.ts and https://github.com/aerogear/aerogear-js-sdk/blob/f9783a4ce192f4653a1668aee5fb7c2ebcf69f9f/packages/core/src/metrics/platform/CordovaAppMetrics.ts Note: clientId has to be sent as well: https://github.com/aerogear/aerogear-js-sdk/blob/f9783a4ce192f4653a1668aee5fb7c2ebcf69f9f/packages/core/src/metrics/MetricsService.ts#L103 Passing headers to sync requests: https://github.com/wtrocki/offline-conflict-strategies/blob/da016ec84771c3ea71e8e5af3a20144e11b97eb2/web/src/apolloClient.js#L27
const httpLink = new HttpLink({ |
uri: uri || '/graphql', |
fetch, |
fetchOptions: fetchOptions || {}, |
credentials: credentials || 'same-origin', |
headers: headers || {}, |
});
|
This one will wait until the JS SDK for sync is moved to proper place. |