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

chore!(gatsby-source-shopify): upgrade from Shopify API version 2022-04 to 2024-04 #39082

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Sep 6, 2024
id: ID!
image: ${prefix}Image
legacyResourceId: String!
metafield(namespace: String! key: String!): ${prefix}Metafield
metafields: [${prefix}Metafield!]! @link(from: "metafields___NODE", by: "id")
products: [${prefix}Product!]! @link(from: "products___NODE", by: "id")
productsCount: Int!
productsCount: Count!
Copy link
Contributor

@pieh pieh Sep 10, 2024

Choose a reason for hiding this comment

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

Note here for changes in type-builders dir - with changes as they are they are breaking changes and would require major bump for shopify plugin (not necessarily bad thing, but just to make sure that implications are clear).

There is an option to preserve current shape for existing fields in Gatsby meaning users wouldn't need to change their existing queries like this:

Suggested change
productsCount: Count!
productsCount: Int! @proxy(from: "productsCount.count")

and exposing other fields that were introduced in now object and not scalar would be adding new field and not changing existing one, so it would non-breaking change feat

        productsCountPrecision: String! @proxy(from: "productsCount.precision")

---edit
Just noticed chore!, so all good about implication of the change 👍

@@ -1 +1 @@
{"description":"Test Collection Description","descriptionHtml":"Test Collection Description","feedback":{"details":[],"summary":"This collection couldn’t be published to Google"},"handle":"test-collection","id":"gid:\/\/shopify\/Collection\/278407151822","image":null,"legacyResourceId":"278407151822","productsCount":2,"ruleSet":{"appliedDisjunctively":false,"rules":[{"column":"IS_PRICE_REDUCED","condition":"","relation":"IS_NOT_SET"}]},"seo":{"description":null,"title":null},"sortOrder":"BEST_SELLING","storefrontId":"Z2lkOi8vc2hvcGlmeS9Db2xsZWN0aW9uLzI3ODQwNzE1MTgyMg==","templateSuffix":"","title":"Test Collection","updatedAt":"2022-03-14T22:39:00Z"}
{"description":"Test Collection Description","descriptionHtml":"Test Collection Description","feedback":{"details":[],"summary":"This collection couldn’t be published to Google"},"handle":"test-collection","id":"gid:\/\/shopify\/Collection\/278407151822","image":null,"legacyResourceId":"278407151822","productsCount":{count: 2, "precision": "EXACT"},"ruleSet":{"appliedDisjunctively":false,"rules":[{"column":"IS_PRICE_REDUCED","condition":"","relation":"IS_NOT_SET"}]},"seo":{"description":null,"title":null},"sortOrder":"BEST_SELLING","storefrontId":"Z2lkOi8vc2hvcGlmeS9Db2xsZWN0aW9uLzI3ODQwNzE1MTgyMg==","templateSuffix":"","title":"Test Collection","updatedAt":"2022-03-14T22:39:00Z"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Those fixtures were modified by hand? (seeing missing " around count field)

I'll try to see if I can properly regenerate them to get actual data (if I can find the store that was used to generate those fixtures)

Copy link
Contributor

Choose a reason for hiding this comment

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

Welp, definitely won't have access to store because those were not generated by gatsby maintainers so editing by hand will have to do. But this should be validated their correctness by doing some comparisons

Copy link
Contributor

Choose a reason for hiding this comment

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

I did update syntaxes (and corresponding snapshots) just to get over unit tests and see if some later tests fail. It does need some work, because I don't think with changes as-is it will work.

In particular referencing Shopify types like Count or Handle in gatsby schema types won't work - we will need to create those types ourselves first so we could use them in gatsby's data layer.

@pieh pieh 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 Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: source-shopify Related to the gatsby-source-shopify plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants