# SaveCartAsync not returning the full cart

**URL:** <https://www.virtocommerce.org/t/savecartasync-not-returning-the-full-cart/698>\
**Category:** dev\
**Created:** [April 16, 2024, 1:44pm UTC](https://www.virtocommerce.org/t/savecartasync-not-returning-the-full-cart/698 "2024-04-16T13:44:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sourabhyadav-oe](https://yyz2.discourse-cdn.com/flex032/user_avatar/www.virtocommerce.org/sourabhyadav-oe/32/1716_2.png) [@sourabhyadav-oe](https://www.virtocommerce.org/u/sourabhyadav-oe)\
**Post date:** [April 16, 2024, 1:44pm UTC](https://www.virtocommerce.org/t/savecartasync-not-returning-the-full-cart/698/1 "2024-04-16T13:44:30Z")

</div>

Hey Virto Community !  
Currently I was trying to create a custom graphql query that updates the dynamic properties of a line item as well as the price. I am returning this in the handler:

```auto
  await cartAggregate.ChangeItemPriceAsync(priceAdjustment);
  return await SaveCartAsync(cartAggregate);

```

The returned cart has missing fields like extendedPrice etc.  
Here are some points related to the implementation:

1. The endpoint is query and not mutation.
2. We have already overriding InnerGetCartAggregateFromCartAsync in CartAggregateRepository.
3. My code for handler for the query:

```auto
public async Task<CartAggregate> Handle(CartItemChangeQuery request, CancellationToken cancellationToken)
{
   var dynamicPropertyHandlerRequest = new UpdateCartItemCommand
    {
        UserId = request.UserId,
        StoreId = request.StoreId,
        LineItemId = request.LineItemId,
        DynamicProperties = request.DynamicProperties,
    };
    var cartAggregate = await GetOrCreateCartFromCommandAsync(dynamicPropertyHandlerRequest);
    await cartAggregate.UpdateCartItemDynamicProperties(request.LineItemId, request.DynamicProperties);

    var lineItem = cartAggregate.Cart.Items.FirstOrDefault(x => x.Id.Equals(request.LineItemId));
    var priceAdjustment = new PriceAdjustment
    {
        LineItem = lineItem,
        LineItemId = request.LineItemId,
        NewPrice = request.Price
    };

    await cartAggregate.ChangeItemPriceAsync(priceAdjustment);
    return await SaveCartAsync(cartAggregate);

}

```

Thanks in advance !
