update<T extends Model> static method

GraphQLRequest<T> update<T extends Model>(
  1. T model, {
  2. QueryPredicate<Model>? where,
})

Generates a request to update a model instance.

final todoWithNewName = someTodo.copyWith(name: 'new name');
final request = ModelMutations.update(todoWithNewName);

An optional where parameter can be supplied as a condition for the update to be evaluated on the server.

Implementation

static GraphQLRequest<T> update<T extends Model>(T model,
    {QueryPredicate? where}) {
  return ModelMutationsFactory.instance.update<T>(model, where: where);
}