Better custom cart fragment typing #2416
theocerutti
started this conversation in
Ideas + Feature Requests
Replies: 2 comments
-
I agree this is a valid feature request. I've create an issue to get this officially in our backlog |
Beta Was this translation helpful? Give feedback.
0 replies
-
We are also facing this issue. Thanks for raising it @theocerutti |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
When we create a cart with a custom
CART_QUERY_FRAGMENT
it creates an incorrect ts typing.Actually, even with your
DEFAULT_CART_QUERY_FRAGMENT
the typing is not correct.If we have to modify the behavior of the cart it's really annoying since we have to override almost every cart types and that's because of almost one big issue.
So if we create a cart with custom query:
Then theses types:
should be:
Indeed we shouldn't have
Cart
as type but the real queried fragment:CustomCartApiQueryFragment
in this case.also
CartGetProps
should allow to add more custom fields since we could add parameter to cart query fragment:it would be nice to have a dynamic
CartGetProps
: we could "read" the custom query fragment and add variable type dynamically toCartGetProps
.otherwise just add a
extraQueryVariables
prop:Beta Was this translation helpful? Give feedback.
All reactions