public <D extends Mutation.Data, T, V extends Mutation.Variables> AppSyncMutationCall<T> mutate(@Nonnull Mutation<D, T, V> mutation) { return mutate(mutation, false); }
public <D extends Mutation.Data, T, V extends Mutation.Variables> AppSyncMutationCall<T> mutate(@Nonnull Mutation<D, T, V> mutation, @Nonnull D withOptimisticUpdates) { return mutate(mutation, withOptimisticUpdates, false); }
public <D extends Mutation.Data, T, V extends Mutation.Variables> void retryConflictMutation(@Nonnull Mutation<D, T, V> mutation, String uniqueIdentifierForOriginalMutation) { //Remove callback from map. This will return null for persistent offline mutations InterceptorCallback callback = (InterceptorCallback) callbackMapForInMemoryMutations.remove(uniqueIdentifierForOriginalMutation); if (callback != null ) { //Put the callback in with the mutation.toString() as the key. This will be picked up to route the the mutation results // back to the callback later. Log.d(TAG, "Proceeding with retry for inMemory offline mutation [" + uniqueIdentifierForOriginalMutation + "]"); callbackMapForInMemoryMutations.put(mutation.toString(), callback); } else { // put in details of persistent mutation. //TODO: Check if this logic is required. Log.d(TAG, "Proceeding with retry for persistent offline mutation [" + uniqueIdentifierForOriginalMutation + "]"); if (persistentOfflineMutationObjectMap.isEmpty()) { Log.d(TAG, "Populating mutations map."); persistentOfflineMutationObjectMap.putAll(appSyncOfflineMutationManager.persistentOfflineMutationManager.persistentOfflineMutationObjectMap); } PersistentOfflineMutationObject object = persistentOfflineMutationObjectMap.remove(uniqueIdentifierForOriginalMutation); persistentOfflineMutationObjectMap.put(mutation.toString(), object); } appSyncClient.mutate(mutation, true).enqueue(null); }
.build(); CreatePostMutation addPostMutation = CreatePostMutation.builder().input(createPostInput).build(); client.mutate(addPostMutation, expected) .enqueue(new GraphQLCall.Callback<CreatePostMutation.Data>() { @Override
.id(p.id()) .build(); ClientFactory.getInstance(view.getContext()).mutate(deletePostMutation).enqueue(new GraphQLCall.Callback<DeletePostMutation.Data>() { @Override public void onResponse(@Nonnull final Response<DeletePostMutation.Data> response) {
.mutate(createArticleMutation, expected) .enqueue(new GraphQLCall.Callback<CreateArticleMutation.Data>() { @Override
.mutate(updateArticleMutation, expectedData) .enqueue(new GraphQLCall.Callback<UpdateArticleMutation.Data>() { @Override
.mutate(updateArticleMutation, expectedData) .enqueue(new GraphQLCall.Callback<UpdateArticleMutation.Data>() { @Override
.build()) .build(); ClientFactory.getInstance(view.getContext()).mutate(updatePostMutation).enqueue(new GraphQLCall.Callback<UpdatePostMutation.Data>() { @Override public void onResponse(@Nonnull final Response<UpdatePostMutation.Data> response) {
.build(); ClientFactory.getInstance(view.getContext()).mutate(updatePostMutation).enqueue(new GraphQLCall.Callback<UpdatePostMutation.Data>() { @Override public void onResponse(@Nonnull final Response<UpdatePostMutation.Data> response) {
final AppSyncMutationCall call = awsAppSyncClient.mutate(addPostMutation, expected);
.mutate(updateArticleMutation, expectedData) .enqueue(new GraphQLCall.Callback<UpdateArticleMutation.Data>() { @Override
AppSyncMutationCall call = awsAppSyncClient.mutate(addPostMutation, expected);
.mutate(updatePostMutation, expected) .enqueue(new GraphQLCall.Callback<UpdatePostMutation.Data>() { @Override
.mutate(createArticleMutation, expected) .enqueue(new GraphQLCall.Callback<CreateArticleMutation.Data>() { @Override
.mutate(updatePostMutation, expected) .enqueue(new GraphQLCall.Callback<UpdatePostMutation.Data>() { @Override
.mutate(createArticle2Mutation, expected) .enqueue(new GraphQLCall.Callback<CreateArticle2Mutation.Data>() { @Override
.mutate(createArticleMutation, expected) .enqueue(new GraphQLCall.Callback<CreateArticleMutation.Data>() { @Override