Skip to content

feat(magento-customer): forward useFormGqlOptions + mutationOptions on CustomerUpdateForm#2624

Merged
paales merged 1 commit into
canaryfrom
feat/customer-update-form-form-options
May 20, 2026
Merged

feat(magento-customer): forward useFormGqlOptions + mutationOptions on CustomerUpdateForm#2624
paales merged 1 commit into
canaryfrom
feat/customer-update-form-form-options

Conversation

@paales
Copy link
Copy Markdown
Member

@paales paales commented May 20, 2026

Summary

CustomerUpdateForm already wraps useCustomerUpdateForm but only forwards the attribute-form config. Consumers can't attach an onComplete (e.g. to close an overlay after a successful save), an onBeforeSubmit (amend or veto variables), or any other option supported by the underlying useFormGqlMutation / useMutation — short of dropping down and rebuilding the form layout themselves.

This PR adds useFormGqlOptions and mutationOptions props that get forwarded straight through to useCustomerUpdateForm, mirroring the two extra arguments the hook already accepts. Defaults preserve existing behaviour.

Why

Coming up in jumbosports we want the /account/name overlay to close after a successful "Save changes" — the canonical GC pattern (if (!errors) router.back()) needs an onComplete. Right now CustomerUpdateForm gives no seam for that.

Test plan

  • <CustomerUpdateForm customer={c} useFormGqlOptions={{ onComplete: (r) => !r.errors && router.back() }} /> closes the overlay after a successful update
  • Omitting both new props yields the existing default behaviour (no observable change for current consumers)
  • Type-check passes: the option types are Pick'd from useCustomerUpdateForm's exact signature, so any future change to the hook flows through automatically

🤖 Generated with Claude Code

…n CustomerUpdateForm

The component already wrapped useCustomerUpdateForm but only passed the
attribute-form config through, so consumers had no way to attach an
onComplete (close the overlay on a successful save), an onBeforeSubmit
(amend or veto variables), or any other useMutation option already
supported by the underlying hook — short of dropping down and rebuilding
the form layout from scratch. Forward both option bags. Defaults
preserve existing behaviour, so the change is backwards compatible.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: cbad1fd

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

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

vercel Bot commented May 20, 2026

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

Project Deployment Actions Updated (UTC)
graphcommerce-246 Ready Ready Preview May 20, 2026 10:16am
graphcommerce-247 Ready Ready Preview May 20, 2026 10:16am
graphcommerce-hygraph-dynamic-rows-ui Ready Ready Preview May 20, 2026 10:16am
graphcommerce-open-source Ready Ready Preview May 20, 2026 10:16am
graphcommerce-storyblok Ready Ready Preview May 20, 2026 10:16am

Request Review

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