update<T extends Model> static method
GraphQLRequest<T>
update<T extends Model>(
- T model, {
- QueryPredicate<
Model> ? where, - String? apiName,
- APIAuthorizationType<
AmplifyAuthProvider> ? authorizationMode, - Map<
String, String> ? headers,
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,
String? apiName,
APIAuthorizationType? authorizationMode,
Map<String, String>? headers,
}) {
return ModelMutationsFactory.instance.update<T>(
model,
where: where,
apiName: apiName,
authorizationMode: authorizationMode,
headers: headers,
);
}