call<T> method

  1. @override
Future<GQLResult<T>> call<T>(
  1. Future<T> func()
)
override

Main wrapper method that all implementations must provide

Implementation

@override
Future<GQLResult<T>> call<T>(Future<T> Function() func) async {
  try {
    final result = await func();
    return Success<T>(data: result);
  } on GQLException catch (exception, stackTrace) {
    return onGQLError(exception, stackTrace);
  } catch (exception) {
    return Failure<T>(exception: GQLException.fromException(exception));
  }
}