Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Version 4 to 5 migration #32069

Closed
wildpow opened this issue May 26, 2021 · 18 comments
Closed

Version 4 to 5 migration #32069

wildpow opened this issue May 26, 2021 · 18 comments
Labels
topic: source-shopify Related to the gatsby-source-shopify plugin

Comments

@wildpow
Copy link

wildpow commented May 26, 2021

I thought it would be good to have a place where people can share their experiences and useful information while testing out V5 release candidates.

@wildpow
Copy link
Author

wildpow commented May 26, 2021

Issue 1 - priceRange is now priceRangeV2

I believe both fields existed in V4. Version 5 only exposes priceRangeV2

@wildpow
Copy link
Author

wildpow commented May 27, 2021

Issue 2 - shopifyId is now storefrontId

Well, not exactly, In version 4, querying shopifyId would produce something like this Z2lkOi8vc2hvcGlmeS9Qcm9kdWN0LzY2NTY2Mjg4ODM2NDA. Because the new plug-in uses the bulk operations API, the same field produces something like this gid://shopify/Product/4525916422209, which in its self not that big of a deal unless you are using these IDs to combine data from multiple sources or something else exotic. The field storefrontId retains the id that the shopifyId did in version 4.

@wildpow
Copy link
Author

wildpow commented May 28, 2021

Issue 2.5 - shopifyId is now storefronId

My store did not like the new shopifyId data.
I'm pretty sure this problem is in how I implemented my store and not with how shopify-buy handles ids. Instead of a rewrite, I just aliased storefronId with shopifyId in my queries like this:

 variants {
          compareAtPrice
          price
          title
          shopifyId   // <------------------Old way
          shopifyId: storefrontId   // <---- New way
        }

@TrevHeath
Copy link

Noticed that availableForSale is not available on the schema. Any idea what replaced it? Currently availableForSale, from my understanding, considers both stock available and the continued overselling functionality.

@unimprobable
Copy link

Does v5 source Shopify blogs? In lower versions, there are allShopifyArticle and allShopifyBlog nodes.

@sslotsky
Copy link
Contributor

@TrevHeath availableForSale is not available in the admin API, which is where we're sourcing from. Although I would think it's better to check this availability against the Storefront API on the front end since it seems like this could change quite between build times.

@sslotsky
Copy link
Contributor

@unimprobable the admin API does not expose this content so we don't currently plan on sourcing it.

@unimprobable
Copy link

@sslotsky Thanks for the reply. That's disappointing as this is a breaking change for my project! Do you have any ideas how to source the Shopify Blog while using v5.0? I see it is exposed in the REST Admin API (not much help there I know).

@marcobiedermann
Copy link
Contributor

I've noticed that allShopifyCollection, shopifyShop, shopifyShopPolicy, allShopifyArticle and so on have been removed. I've set read-access to all of them in the admin panel. Is this by intention or am I missing something?

@unimprobable
Copy link

I've noticed that allShopifyCollection, shopifyShop, shopifyShopPolicy, allShopifyArticle and so on have been removed. I've set read-access to all of them in the admin panel. Is this by intention or am I missing something?

@marcobiedermann You can access the allShopifyCollection at least by specifying "collections" in the gatsby-config.js file.

shopifyConnections: ["collections"],

@sslotsky
Copy link
Contributor

@unimprobable we use the bulk operations portion of the admin API to source everything. That said, I don't think I knew that they were available from the REST Admin API until now. We'd have to do some research to see if this resource type would support incremental builds, but if it does, I think we could reconsider it.

In the meantime you could potentially use gatsby-source-graphql to fetch this stuff from the Storefront API.

@unimprobable
Copy link

In the meantime you could potentially use gatsby-source-graphql to fetch this stuff from the Storefront API.

Good idea, I will try that. Thanks, @sslotsky !

@sslotsky
Copy link
Contributor

@marcobiedermann there are some things that aren't exposed by the admin/bulk API, and since that's how we currently source all of our data for v5, we share its limitations. That said, we'd love to understand what your use case is for any piece of data you need that we aren't currently exposing for you. So if you really need e.g. shopifyShop and shopifyShopPolicy, please open a new issue and we'll see if there's anything can do.

As for the others: allShopifyArticle is also what @unimprobable was asking about so feel free to reference our discussion there, and allShopifyCollection is available on an opt-in basis as pointed out by @unimprobable. It's quite possible that we should have included collections by default instead of opt-in.

@marcobiedermann
Copy link
Contributor

@sslotsky
Thank you very much for your quick reply.
Actually, I am using all sources, I've mentioned above.
I've set up a demo shop right here: https://marcobiedermann-gatsby-shopify.netlify.app/ (source: https://github.com/marcobiedermann/gatsby-shopify)
Of course, this is all fake data and nothing to use on a production application.

These are my use cases:
shopifyShop: Store name, currency
shopifyShopPolicy: Privacy, Refund, Terms of Services
allShopifyArticle: Blogs and Articles per blog and comments (note that you can have multiple blogs)
allShopifyCollection: I think collections and vendors are kinda interchangable

@unimprobable
Copy link

I am trying to use the downloadImages: true flag, but am getting timed out at the Shopify side (I think).

I used to solve this issue with a small paginationSize. Is there any way to affect the request like that now?

@sslotsky
Copy link
Contributor

@marcobiedermann can you please open another issue as I requested previously? We will make this thread too noisy by discussing this here. Similarly @unimprobable there is already an issue open for this problem.

In general let's try to keep this thread dedicated to collecting tips for the migration and not reporting new issues, please.

@rowanflack
Copy link

rowanflack commented Jun 17, 2021

Another difference between plugin versions:

variants.image.id = gid://shopify/ProductImage/22817961902275

@petertait
Copy link

Another difference seems to be the lack of custom domains for the checkout webUrl. From previous plugin:

// If you are running your shop on a custom domain, you need to use that
// as the shop name, without a trailing slash, for example:
// shopName: "gatsby-shop.com",

This is no longer mentioned, which results in the checkout domain being: shopname.myshopify.com/... rather than shopname.com/...

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 23, 2021
@DanielSLew DanielSLew transferred this issue from gatsbyjs/gatsby-source-shopify Jun 23, 2021
@LekoArts LekoArts added topic: source-shopify Related to the gatsby-source-shopify plugin and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 23, 2021
@gatsbyjs gatsbyjs locked and limited conversation to collaborators Jun 23, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
topic: source-shopify Related to the gatsby-source-shopify plugin
Projects
None yet
Development

No branches or pull requests

8 participants