-
Notifications
You must be signed in to change notification settings - Fork 122
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
W-14867867 Fix invalid query params warnings and allow custom query #1655
Conversation
packages/template-retail-react-app/app/pages/checkout/partials/payment.jsx
Show resolved
Hide resolved
What happens if an API we call into adds support for a new query param? For example, in 24.3, Product Search will add support for |
API call-wise, new query param will get passed into the API call if isomorphic accepts those params since comemrce-react-sdk just passed those params into isomorphic functions for SCAPI calls. However, for caching mechanism, we still need to adjust the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed manually that Invalid Parameter
warnings no longer appear and that passing a custom query parameter like c_param
in a SCAPI call in template-retail-react-app
can be seen as part of the SCAPI request using dev tools
Also, once you get this merged in, please close #1453 🙏
packages/template-retail-react-app/app/pages/product-list/index.jsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the most part everything looks good. But I think there is one thing to change to make this just right. See the comment here.
Description
With the change from isomorphic that allow passing custom query (c_${string}). We'd want the commerce-react-sdk also adopt the changes. Commerce-react-sdk hooks will automatically accept any custom query key since we reuse type from isomorphic. However, we need to adjust our hooks to allow custom query key in react-query
This PR
Types of Changes
Changes
How to Test-Drive This PR
Check that custom query params is also present in react query cache. e.g
Add an custom query that does not start with c_. You should see a warning in the console. E.g
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization