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 = 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;
}