Skip to main content

cartMetafieldDeleteDefault

Creates a function that accepts a string key and removes the matching metafield from the cart.

required

CartMetafieldDeleteFunction

export type = ( key: Scalars['String']['input'], optionalParams?: , ) => Promise<>;
Examples

JavaScript

import {cartMetafieldDeleteDefault} from '@shopify/hydrogen';

const cartDeleteMetafield = cartMetafieldDeleteDefault({
storefront,
getCartId,
});

const result = await cartDeleteMetafield('namespace.key');
Was this page helpful?