Skip to content

Updated to Apollo Client 4#2565

Merged
paales merged 8 commits intocanaryfrom
feature/apollo-client4
Dec 29, 2025
Merged

Updated to Apollo Client 4#2565
paales merged 8 commits intocanaryfrom
feature/apollo-client4

Conversation

@paales
Copy link
Member

@paales paales commented Dec 29, 2025

Note

Upgrade to Apollo Client v4

  • Refactors core GraphQL layer and consumers to AC4: replace setContext/onError with SetContextLink/ErrorLink, adopt CombinedGraphQLErrors, export rxjs helpers, add LocalState, adjust React hooks imports, and remove NormalizedCacheObject generics
  • Updates provider, links, utils, and hooks (useFormGql*, cart/customer/payment flows) to new types/APIs; broad null-safe access fixes across example pages
  • Adapts UI error components to AC4 error shapes; replaces deprecated helpers (e.g., argument/directive removal) and adds custom replacements

Tooling and CI

  • Migrates tests from Jest to Vitest; removes Jest config and updates scripts
  • Replaces bundlesize.yml with simplified pr-analysis workflow

Docs

  • Adds upgrade guides (7→8, 8→9) and notes to clear .next during upgrades

Written by Cursor Bugbot for commit ea75841. This will update automatically on new commits. Configure here.

@changeset-bot
Copy link

changeset-bot bot commented Dec 29, 2025

🦋 Changeset detected

Latest commit: ea75841

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 83 packages
Name Type
@graphcommerce/graphql-codegen-markdown-docs Major
@graphcommerce/graphql-codegen-relay-optimizer-plugin Major
@graphcommerce/next-config Major
@graphcommerce/ecommerce-ui Major
@graphcommerce/googlerecaptcha Major
@graphcommerce/graphql Major
@graphcommerce/graphql-mesh Major
@graphcommerce/hygraph-cli Major
@graphcommerce/hygraph-dynamic-rows Major
@graphcommerce/hygraph-dynamic-rows-ui Major
@graphcommerce/hygraph-ui Major
@graphcommerce/magento-cart Major
@graphcommerce/magento-cart-payment-method Major
@graphcommerce/magento-category Major
@graphcommerce/magento-compare Major
@graphcommerce/magento-customer Major
@graphcommerce/magento-payment-braintree Major
@graphcommerce/magento-payment-tokens Major
@graphcommerce/magento-product Major
@graphcommerce/magento-product-configurable Major
@graphcommerce/magento-product-downloadable Major
@graphcommerce/magento-recently-viewed-products Major
@graphcommerce/magento-search Major
@graphcommerce/magento-store Major
@graphcommerce/magento-wishlist Major
@graphcommerce/next-ui Major
@graphcommerce/react-hook-form Major
@graphcommerce/magento-graphcms Major
@graphcommerce/magento-open-source Major
@graphcommerce/algolia-categories Major
@graphcommerce/algolia-insights Major
@graphcommerce/algolia-personalization Major
@graphcommerce/algolia-products Major
@graphcommerce/algolia-recommend Major
@graphcommerce/algolia-search Major
@graphcommerce/cli Major
@graphcommerce/googleanalytics Major
@graphcommerce/lingui-next Major
@graphcommerce/magento-cart-shipping-method Major
@graphcommerce/magento-graphql-rest Major
@graphcommerce/framer-scroller-example Major
@graphcommerce/address-fields-nl Major
@graphcommerce/magento-cart-coupon Major
@graphcommerce/magento-cart-email Major
@graphcommerce/magento-cart-items Major
@graphcommerce/magento-cart-pickup Major
@graphcommerce/magento-cart-shipping-address Major
@graphcommerce/magento-newsletter Major
@graphcommerce/magento-payment-adyen Major
@graphcommerce/magento-payment-included Major
@graphcommerce/magento-payment-multisafepay Major
@graphcommerce/magento-payment-paypal Major
@graphcommerce/magento-product-bundle Major
@graphcommerce/magento-product-grouped Major
@graphcommerce/magento-review Major
@graphcommerce/magento-search-overlay Major
@graphcommerce/mollie-magento-payment Major
@graphcommerce/magento-cart-checkout Major
@graphcommerce/magento-cms Major
@graphcommerce/magento-graphql Major
@graphcommerce/magento-payment-klarna Major
@graphcommerce/magento-product-simple Major
@graphcommerce/magento-product-virtual Major
@graphcommerce/graphcms-ui Major
@graphcommerce/google-datalayer Major
@graphcommerce/demo-magento-graphcommerce Major
@graphcommerce/google-playstore Major
@graphcommerce/googletagmanager Major
@graphcommerce/framer-next-pages-example Major
@graphcommerce/docs Major
@graphcommerce/browserslist-config-pwa Major
@graphcommerce/changeset-changelog Major
@graphcommerce/eslint-config-pwa Major
@graphcommerce/graphql-codegen-near-operation-file Major
@graphcommerce/misc Major
@graphcommerce/prettier-config-pwa Major
@graphcommerce/typescript-config-pwa Major
@graphcommerce/framer-next-pages Major
@graphcommerce/framer-scroller Major
@graphcommerce/framer-utils Major
@graphcommerce/image Major
@graphcommerce/service-worker Major
@graphcommerce/image-example Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Dec 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
graphcommerce-246 Ready Ready Preview Dec 29, 2025 4:15pm
graphcommerce-247 Ready Ready Preview Dec 29, 2025 4:15pm
graphcommerce-hygraph-dynamic-rows-ui Ready Ready Preview Dec 29, 2025 4:15pm
graphcommerce-open-source Ready Ready Preview Dec 29, 2025 4:15pm

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 28

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

await lock({
method: selectedMethod?.code ?? '',
order_number: result.data.placeOrder.order.order_number,
order_number: order?.order_number ?? '',
Copy link

Choose a reason for hiding this comment

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

Undefined variable order causes runtime reference error

The code references order?.order_number but the variable order is never defined anywhere in this file. The old code used result.data.placeOrder.order.order_number directly, but the new code references a non-existent order variable. This will throw a ReferenceError: order is not defined at runtime during the payment process, breaking the MSP payment flow entirely.

Fix in Cursor Fix in Web

const { mollie_payment_token, order_number, mollie_redirect_url } =
result.data.placeOrder.order
const order = result.data?.placeOrder?.order
const { mollie_payment_token, order_number, mollie_redirect_url } = order
Copy link

Choose a reason for hiding this comment

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

Optional chaining after type assertion causes potential destructuring error

After calling assertMollieOrderPlaced(result) which narrows the type to guarantee result.data.placeOrder.order exists, the code uses optional chaining result.data?.placeOrder?.order which unnecessarily widens the type back to potentially undefined. The subsequent destructuring const { mollie_payment_token, order_number, mollie_redirect_url } = order will throw a TypeError if order is undefined. While the assertion protects against this at runtime, the inconsistent pattern undermines TypeScript's type narrowing and could be confusing.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant