Get deliveryOptions estimatedCost Input Error

Hey Community,

I am new to building shopify functions and have a usecase where we need to get the current delivery cost and update it based on some parameters.

I am following this tutorial and was trying to get estimatedCost in input but been running into error -

GraphQL Document Validation failed with 2 errors;

Error 0: Cannot query field “estimatedCost” on type “CartDeliveryOption”.

at

query Input {
  cart {
    lines {
      merchandise {
        ... on ProductVariant {
          product {
            id
          }
        }
      }
    }
    deliveryGroups {
      id
      deliveryOptions {
        handle
        title
        estimatedCost {
          amount
        }
      }
      selectedDeliveryOption{
        code
        deliveryMethodType
        estimatedCost
      }
    }
  }
}

Is there a way to get the cost associated with all delivery options?

Update :-

Seems like estimatedCost is deprecated, I was looking at old documentation ;(

query Input {
  cart {
    lines {
      merchandise {
        ... on ProductVariant {
          product {
            id
          }
        }
      }
    }
    deliveryGroups {
      id
      deliveryOptions {
        handle
        title
        estimatedCost {
          amount
        }
      }
      selectedDeliveryOption{
        code
        deliveryMethodType
        cost
      }
    }
  }
}