getResellerCount method
Implementation
Future getResellerCount(String userId) async {
GraphQLClient _client = graphQLConfiguration.clientToQuery();
var resellerCountGql = """
query resellerCountByUserId(\$userId: String) {
resellerCountByUserId(userId: \$userId)
}
""";
var variable = {"userId": userId};
QueryResult result = await _client.query(QueryOptions(
document: gql(resellerCountGql),
variables: variable,
fetchPolicy: FetchPolicy.networkOnly));
if (!result.hasException) {
var countResult = result.data!['resellerCountByUserId'];
if (countResult != null) {
resellerCount = countResult;
}
}
return resellerCount;
}