delete<_Model extends GraphqlModel> method
Future<bool>
delete<_Model extends GraphqlModel>(
- _Model instance, {
- Query? query,
- ModelRepository<
GraphqlModel> ? repository,
Remove a model instance
Implementation
@override
Future<bool> delete<_Model extends GraphqlModel>(instance, {query, repository}) async {
final request = GraphqlRequest<_Model>(
action: QueryAction.delete,
instance: instance,
modelDictionary: modelDictionary,
query: query,
variableNamespace: variableNamespace,
).request;
if (request == null) return false;
await for (final resp in link.request(request)) {
return resp.errors?.isEmpty ?? true;
}
return false;
}