getCartSkuWeight method

Future getCartSkuWeight(
  1. String userId
)

Implementation

Future getCartSkuWeight(String userId) async {
  GraphQLClient _client = graphQLConfiguration.clientToQuery();

  var cartSkuWeightGql = """
             query getCartSkuWeight(\$userId: String) {
              getCartSkuWeight(userId: \$userId)
            }
          """;

  final vble = {
    "userId": userId,
  };
  QueryResult result = await _client.query(QueryOptions(
    document: gql(cartSkuWeightGql),
    variables: vble,
    fetchPolicy: FetchPolicy.networkOnly,
  ));

  if (!result.hasException) {
    var skuWeight = result.data!['getCartSkuWeight'];

    if (skuWeight != null) {
      cartSkuWeight = skuWeight;
    }
    return cartSkuWeight;
  }
  return cartSkuWeight;
}