-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
refactor: filter out variant media from product media query #6165
Conversation
Signed-off-by: Will Lopez <[email protected]>
@willopez, @aldeed is correct. It "was" intentional, though not properly displayed in the Admin UI. The media bubbles up to the top. So If I upload an image at the This is so you can organize the top-level product images if you want, and so you don't have to upload images to every single level. You could just upload only option media, and leave the other levels blank. This made sense when the products were displayed on the storefront from the products collection. Now that we get the info from the Catalog, we can still have that functionality there, while doing something different with Products. I can see @willopez intent here because... When displaying the product images, the bubble-up effect is useful. When uploading images in the Admin UI, having child media in the uploader, especially at the product level, is overwhelming. Perhaps adding a param the Otherwise, we can always filter out the media in the UI and display a better user interface for managing direct media dependencies, while also allowing the organization of all product media at the top-level. |
Adding a param |
Sounds good to me 👍 |
@aldeed We don't currently rely on this behavior because we don't use Product Media at all but I think for building an admin screen it would be good to have the flexibility that the |
@willopez query product($productId: ID!, $shopId: ID!) {
product(productId: $productId, shopId: $shopId) {
media(shouldIncludeVariantMedia: false) {
_id
URLs {
small
}
}
}
} |
Signed-off-by: Will Lopez <[email protected]>
…merce/reaction into willopez-product-media-fixes
@mikemurray @aldeed @spencern |
Signed-off-by: Will Lopez <[email protected]>
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.
A few comments
definition Signed-off-by: Will Lopez <[email protected]>
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.
👍
Impact: minor
Type: bugfix
Issue
The top level product media resolver was returning media from variants. This causes all media in child variants and options to be rendered on the parent top level product.
Solution
Filter out variant media from product media resolved.
Breaking changes
NONE
Variables:
Testing