-
Notifications
You must be signed in to change notification settings - Fork 284
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
Use Customer Account API in templates/skeleton
& template/demo-store
#1576
Conversation
589937e
to
1ea00be
Compare
1ea00be
to
a345d38
Compare
a345d38
to
59045a0
Compare
templates/skeleton/app/graphql/customer/CustomerDetailsQuery.ts
Outdated
Show resolved
Hide resolved
59045a0
to
edb3e3b
Compare
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.
Great job! I've left a few comments with issues related to GraphQL / Codegen 🙏 (especially #1576 (comment) is important).
Also, I noticed the generated types for CAAPI weren't prettified... I've fixed that in #1578 👍
templates/skeleton/app/graphql/customer/CustomerDetailsQuery.ts
Outdated
Show resolved
Hide resolved
255e4e2
to
3745ee2
Compare
7eceba3
to
8dc58a0
Compare
a5bda1d
to
f611d85
Compare
Co-authored-by: Bret Little <[email protected]>
Co-authored-by: Bret Little <[email protected]>
* ✨ move demo-store to caapi * update login button * login flow + account page * customer profile edit * address edit * cart edit * order id page * fix eslint error, strange my VS code is giving different suggestions * Update packages/hydrogen/src/customer/customer.ts Co-authored-by: Bret Little <[email protected]> * Update packages/hydrogen/src/customer/customer.ts Co-authored-by: Bret Little <[email protected]> * remove redirectPath from authorize --------- Co-authored-by: Bret Little <[email protected]>
5da532b
to
64514f7
Compare
64514f7
to
c93bd39
Compare
c93bd39
to
e22157b
Compare
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.
Looking good!
0e7edf5
to
84b99be
Compare
84b99be
to
41cd7e0
Compare
41cd7e0
to
3f085ba
Compare
WHY are these changes introduced?
The Customer Account API will be officially release in Jan of 2024. This PR aim to replaced all current storefront API customer usage with the new API.
WHAT is this pull request doing?
Add
app/graphql/customer
folder to contain all Customer Account API GraphQL query & mutation. This is needed because currently you cannot use the#graphql
comment annotation in type generation with multiple schema in one file.Change codegen to exclude graphql type generation for
app/graphql
folder. This folder will be dedicated for any graphql usage that is not Storefront API.🔥 remove account activate, recover, register and reset. Since these are not supported in the new CA API with new customer flow.
Create
customerClient
in remix context like the example and also set up login/logout flow.Pages to update in
templates/skeleton
customerAccessToken
into customerAccount utility to keep it uniform in case for future change)createCustomerClient
is use without all the variables. ie. when usingmock.shop
Other templates & examples with usage of
customerAccessToken
:templates/demo-store
examples/multipass/
(keeping it as it. new project coming for this)HOW to test your changes?
Follow customer-api example for ngrok setup and interact with any
/account
route.Ensure the customer information will be passed to cart when a login customer try to view cart.
Post-merge steps
Checklist