How to use the offix-cache.createMutationOptions function in offix-cache

To help you get started, we’ve selected a few offix-cache examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aerogear / offix / packages / offix-client / src / OfflineClient.ts View on Github external
protected createOfflineMutationOptions(
    options: MutationHelperOptions): MutationOptions {
    const offlineMutationOptions = createMutationOptions(options);

    offlineMutationOptions.context.conflictBase = getBaseStateFromCache(
      this.cache as unknown as ApolloCacheWithData,
      this.config.conflictProvider,
      offlineMutationOptions as unknown as MutationOptions
    );

    if (!offlineMutationOptions.update && this.config.mutationCacheUpdates) {
      offlineMutationOptions.update = this.config.mutationCacheUpdates[offlineMutationOptions.context.operationName];
    }
    return offlineMutationOptions;
  }
github aerogear / offix / packages / offix-client / src / ApolloOfflineClient.ts View on Github external
protected createOfflineMutationOptions(
    options: MutationHelperOptions): MutationOptions {
    const offlineMutationOptions = createMutationOptions(options);

    offlineMutationOptions.context.conflictBase = getBaseStateFromCache(
      this.cache as unknown as ApolloCacheWithData,
      this.conflictProvider,
      offlineMutationOptions as unknown as MutationOptions
    );

    if (!offlineMutationOptions.update && this.mutationCacheUpdates) {
      offlineMutationOptions.update = this.mutationCacheUpdates[offlineMutationOptions.context.operationName];
    }
    return offlineMutationOptions;
  }
}

offix-cache

GraphQL Mutation and Subscription Helpers

Apache-2.0
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Similar packages