deleteProfile method Null safety
Deletes our user profile in the backend
Returns true on success, false on error.
Implementation
@protected
Future<bool> deleteProfile() async {
const gqlQueryString = '''
mutation DeleteProfile {
deleteProfile
}
''';
try {
final queryResult = await graphQLClient
.mutate<void>(MutationOptions(document: gql(gqlQueryString)));
if (queryResult.hasException) {
logger?.e(queryResult.exception.toString());
return false;
}
return true;
} catch (e, stackTrace) {
logger?.e('Could not delete user profile', e, stackTrace);
return false;
}
}