first method

Future<T?> first()

Find the first object that satisfies the query. Returns null, if no object is found.

Implementation

Future<T?> first() async {
  ParseResponse parseResponse =
      await (QueryBuilder.copy(this)..setLimit(1)).query();
  if (parseResponse.success) {
    return parseResponse.results?.first;
  }
  throw parseResponse.error ?? ParseError();
}