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

SFAPI 2024-10 cart update #2572

Merged
merged 9 commits into from
Oct 21, 2024
Merged

SFAPI 2024-10 cart update #2572

merged 9 commits into from
Oct 21, 2024

Conversation

wizardlyhel
Copy link
Contributor

@wizardlyhel wizardlyhel commented Sep 27, 2024

Breaking change

Update all cart mutation methods from createCartHandler to return cart warnings.

As of API version 2024-10, inventory errors about stock levels will no longer be included in the userErrors of cart mutations. Inventory errors will now be available in a new return field warnings and will contain explicit code values of MERCHANDISE_NOT_ENOUGH_STOCK or MERCHANDISE_OUT_OF_STOCK. Reference: https://shopify.dev/changelog/cart-warnings-in-storefront-api-cart

Upgrade instructions

If your project is displaying inventory not enough and/or inventory out of stock errors by parsing cartUserErrors, make sure to update your code to parse cartWarnings instead.

PR description

WHY are these changes introduced?

Fixes #0000

WHAT is this pull request doing?

HOW to test your changes?

Post-merge steps

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

Copy link
Contributor

shopify bot commented Sep 27, 2024

Oxygen deployed a preview of your hl-2024-10-cart-update branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
classic-remix ✅ Successful (Logs) Preview deployment Inspect deployment October 21, 2024 8:18 PM
metaobjects ✅ Successful (Logs) Preview deployment Inspect deployment October 21, 2024 8:18 PM
custom-cart-method ✅ Successful (Logs) Preview deployment Inspect deployment October 21, 2024 8:18 PM
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment October 21, 2024 8:18 PM
third-party-queries-caching ✅ Successful (Logs) Preview deployment Inspect deployment October 21, 2024 8:18 PM
sitemap ✅ Successful (Logs) Preview deployment Inspect deployment October 21, 2024 8:17 PM

Learn more about Hydrogen's GitHub integration.

@@ -13,3 +13,11 @@ export const MINIMAL_CART_FRAGMENT = `#graphql
checkoutUrl
}
`;

export const CART_WARNING_FRAGMENT = `#graphql
fragment CartApiWarning on CartWarning {
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL

@rbshop rbshop added the 2024.10 label Oct 18, 2024
Base automatically changed from hl-2024-10-sfapi to main October 21, 2024 20:15
@wizardlyhel wizardlyhel merged commit 8337e53 into main Oct 21, 2024
13 checks passed
@wizardlyhel wizardlyhel deleted the hl-2024-10-cart-update branch October 21, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants