Skip to content

Conversation

@blittle
Copy link
Contributor

@blittle blittle commented May 5, 2022

Resolves #1127

/** A [MetafieldConnection](https://shopify.dev/api/storefront/reference/common-objects/metafieldconnection). */
metafields?: PartialDeep<MetafieldConnection>
) {
metafields?.edges?.[0]?.node;
Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const initialVariant = flattenConnection(product.variants)[0];

const productMetafields = useParsedMetafields(product.metafields);
const productMetafields = useParsedMetafields(product.metafields || {});
Copy link
Contributor Author

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?

@blittle blittle requested a review from frehner May 5, 2022 15:09
Copy link
Contributor

@frehner frehner left a 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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@blittle blittle merged commit d0dada0 into v1.x-2022-07 May 5, 2022
@blittle blittle deleted the bl-fix-1127 branch May 5, 2022 16:02
blittle added a commit that referenced this pull request May 9, 2022
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ProductProvider requires metafields when it should not

2 participants