-
Notifications
You must be signed in to change notification settings - Fork 267
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 the OptimisticCart
type to properly retain the generic of line items
#2327
Conversation
Oxygen deployed a preview of your
Learn more about Hydrogen's GitHub integration. |
lines: OptimisticCartLine[]; | ||
lines: CartLine[]; |
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.
Needed to change, because just using the OptimisticCartLine
directly without a generic means the default API query is used.
#/***********************************************/ | ||
#/********** EXAMPLE UPDATE STARTS ************/ | ||
sellingPlanAllocation { | ||
sellingPlan { | ||
name | ||
} | ||
} | ||
#/***********************************************/ |
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.
Adding sellingPlanAllocation
here.
b8c908a
to
a67a4dd
Compare
/snapit |
🫰✨ Thanks @blittle! Your snapshot has been published to npm. Test the snapshot by updating your "@shopify/hydrogen": "0.0.0-snapshot-20240712202726" |
a0a9965
to
d4e17c7
Compare
I've experienced this as well! Would love to see it come in the next release :) |
WHY are these changes introduced?
@brookslybrand reported an issue where the the generic on
OptimisticCart
did not propagate to line items. For example, this would produce a type of the default cart lines, not the generic api fragment provided.With this change, now the
CartAPIQueryFragment
is preserved.Checklist