-
Notifications
You must be signed in to change notification settings - Fork 326
Make metafields optional within the ProductProvider. Fixes #1127 #1209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| /** A [MetafieldConnection](https://shopify.dev/api/storefront/reference/common-objects/metafieldconnection). */ | ||
| metafields?: PartialDeep<MetafieldConnection> | ||
| ) { | ||
| metafields?.edges?.[0]?.node; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure what this was doing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh weird, I seem to have accidentally added it in a previous PR. https://github.com/Shopify/hydrogen/pull/959/files#diff-4c6b39cf631dbcd985b50139a085365a972de3824078975657f69500363426c8
| const initialVariant = flattenConnection(product.variants)[0]; | ||
|
|
||
| const productMetafields = useParsedMetafields(product.metafields); | ||
| const productMetafields = useParsedMetafields(product.metafields || {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the default product details page shows metafields, maybe we do want it to error?
frehner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
| /** A [MetafieldConnection](https://shopify.dev/api/storefront/reference/common-objects/metafieldconnection). */ | ||
| metafields?: PartialDeep<MetafieldConnection> | ||
| ) { | ||
| metafields?.edges?.[0]?.node; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh weird, I seem to have accidentally added it in a previous PR. https://github.com/Shopify/hydrogen/pull/959/files#diff-4c6b39cf631dbcd985b50139a085365a972de3824078975657f69500363426c8
* v1.x-2022-07: Fix stale product options (#1210) Upgrade body-parser in hydrogen package (#1232) Add new options to Money and useMoney (#1215) fix links (#1229) Update turbo and instructions for developing `dev` (#1225) Heck - deploy all branches to Oxygen add context for initialvariantid (#1217) Build chunks are inside assets folder (#1211) Upgraded to SFAPI 2022-07 (#1214) [ci] release v1.x-2022-07 (#1205) Make this a patch instead of minor add references to video in file_reference block (#1197) Laying the foundation for building components in isolation (#1188) Make metafields optional within the ProductProvider. Fixes #1127 (#1209) Add README to /templates directory (#1163) fix perf tracking and make it optional from developer's end (#1096) docs fixes (#1204)
Resolves #1127