Home > @vue-storefront/magento-api > cart
cart() function
Fetches a cart by its ID
Signature:
export default function cart(context: Context, cartId: string, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise<ApolloQueryResult<CartQuery>>;
Parameters
Parameter | Type | Description |
---|---|---|
context | Context | VSF context |
cartId | string | ID of the cart to fetch |
customQuery | CustomQuery | (Optional) custom GraphQL query that extends the default one |
customHeaders | CustomHeaders | (Optional) (optional) - custom headers that extends the default headers |
Returns:
Promise<ApolloQueryResult<CartQuery>>