parseMetafield
The parseMetafield
utility creates a new metafield object with a value that has been parsed according to the metafield type.
Example code
Anchor link to section titled "Example code"
You can also wrap parseMetafield
in useMemo()
to maintain a stable object identity across renders.
This hook takes a single object with the following key:
Key | Type | Description |
---|---|---|
metafields? | PartialDeep<MetafieldConnection> |
A MetafieldConnection. |
Return type
Anchor link to section titled "Return type"This hook returns an array of metafields whose values
have been parsed according to the metafield type
. For details on the parsed value, refer to the parseMetafieldValue
utility.