-
Notifications
You must be signed in to change notification settings - Fork 288
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
fix: don't execute unnecessary requests for anonymous cart on initial load #705
Conversation
load Signed-off-by: Will Lopez <[email protected]>
Signed-off-by: Will Lopez <[email protected]>
Signed-off-by: Will Lopez <[email protected]>
Signed-off-by: Will Lopez <[email protected]>
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.
LGTM! are we including this in the pending release branch?
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.
I think using Lazy Query currently is the best solution.
Although the related errors in the Apollo-client repo were closed with the release of 3.0.1, multiple people still observed the described error.
I also tried upgrading apollo-client to the latest v3.0.2 and as that didnt work, also upgraded the remaining apollo packages that we're using to their latest version, also without any success.
After looking at your changes I checked out the PR locally and can confirm that the error is fixed.
Tried out anonymous carts, account carts and reconciliation, all seem to work fine.
The only minor change I'd like to suggest is the wording for refetchAccountCart
/ refetchCartAnonymous
.
Signed-off-by: Will Lopez <[email protected]>
@manueldelreal Yes, we will include this PR in the upcoming release. |
@janus-reith Thanks for the suggestions and testing your suggestion has been implemented. |
@willopez Looks like the upcoming v3.1.2 might fix this, so we could remove that workaround again: apollographql/apollo-client#6752 |
Resolves #701
Impact: minor
Type: bugfix
Issue
Solution
lazyQuery
s to control when cart requests are executed.anonymous
to denote when a user is anonymousBreaking changes
Testing
anonymousCartByCartIdQuery
request are executed.api/token
route