Skip to content
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

API Ref(store): Issue in Get Product Variants #5045

Closed
1 of 2 tasks
Djarma opened this issue Sep 13, 2023 · 5 comments · Fixed by #5053
Closed
1 of 2 tasks

API Ref(store): Issue in Get Product Variants #5045

Djarma opened this issue Sep 13, 2023 · 5 comments · Fixed by #5053

Comments

@Djarma
Copy link

Djarma commented Sep 13, 2023

Preliminary Checks

Issue Summary

Get product variants store api endpoint documentation says that fields can be used as query parameter to filter fields included in returned product variants

image

but it throws an error

image

image

How can this issue be resolved?

No response

Are you interested in working on this issue?

  • I would like to fix this issue
@shahednasser
Copy link
Member

Thank you for submitting this issue! After taking a look at the List Product Variants endpoint I can see that this is not a documentation error, so this could be a bug

cc @olivermrbl

@olivermrbl
Copy link
Contributor

I'll have a look at this. Thanks for filing the issue.

Are you intentionally using the list endpoint to fetch variants by id?

If you are only querying for a single variant, I suggest you use the get endpoint instead:

.../store/variants/variant_1234?fields=id

fields is a supported param (and works) in this route :)

@Djarma
Copy link
Author

Djarma commented Sep 13, 2023

We need to list all variants and paginate them, this was just for test

@Djarma
Copy link
Author

Djarma commented Sep 15, 2023

Is it possible to tag, build and push this to https://www.npmjs.com/package/@medusajs/medusa-js?activeTab=versions?

@olivermrbl
Copy link
Contributor

@Djarma not sure what you mean. The fix will be part of the next release, which will be cut later today :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants