Skip to content
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

fix(gatsby-source-shopify): Use id as cacheKey for base64 image #37397

Merged
merged 3 commits into from
Jan 11, 2023

Conversation

beadlespouse
Copy link
Contributor

Description

This PR fixes a bug with gatsby-source-shopify. Specifically, passing the placeholder: 'BLURRED' option to a ShopifyMediaImage GraphQL query doesn't work - gatsby source shopify returns an error, "TypeError: Cannot read properties of undefined (reading 'contentDigest')".

The change is simple, switch out the 'contentDigest' parameter for an 'imageId' parameter. Content digest was 'image.internal.contentDigest' - imageId is 'image.id'. This parameter is a unique string used as a cacheKey for the image.

Documentation

The gatsby source shopify docs don't go into this. It's a tiny change.

Related Issues

Fixes #35930

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 3, 2023
@LekoArts LekoArts added topic: source-shopify Related to the gatsby-source-shopify plugin topic: source-plugins Relates to the Gatsby source plugins (e.g. -filesystem) and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 10, 2023
@LekoArts LekoArts changed the title Fix Bug that breaks use of placeholder: 'BLURRED' in gatsby-source-shopify fix(gatsby-source-shopify): Use id as cacheKey for base64 image Jan 10, 2023
Copy link
Contributor

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

Thanks 👍

@LekoArts LekoArts merged commit 75ced40 into gatsbyjs:master Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: source-plugins Relates to the Gatsby source plugins (e.g. -filesystem) topic: source-shopify Related to the gatsby-source-shopify plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gatsby-source-shopify: Placeholder BLURRED error w/ Shopify CDN
2 participants