getResellerCount method

Future getResellerCount(
  1. String userId
)

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