delete<_Model extends GraphqlModel> method

  1. @override
Future<bool> delete<_Model extends GraphqlModel>(
  1. _Model instance, {
  2. Query? query,
  3. ModelRepository<GraphqlModel>? repository,
})

Remove a model instance

Implementation

@override
Future<bool> delete<_Model extends GraphqlModel>(instance, {query, repository}) async {
  final request = createRequest<_Model>(action: QueryAction.delete, query: query);
  if (request == null) return false;
  await for (final resp in link.request(request)) {
    return resp.errors?.isEmpty ?? true;
  }
  return false;
}