mutate method

Future<T?> mutate(
  1. P params
)

Safely executes the mutation with params.

Catches any thrown exceptions and returns null on failure (updating status and error signals).

final result = await createTodo.mutate('New Task');
if (result != null) {
  print('Success');
}

Implementation

Future<T?> mutate(P params) async {
  try {
    return await mutateAsync(params);
  } catch (_) {
    return null;
  }
}