Shopify / shopify-app-js

MIT License
268 stars 104 forks source link

Types in order and product dont match the real world rest api and miss clarity in some cases #772

Open jakeleventhal opened 1 year ago

jakeleventhal commented 1 year ago

Reopening Shopify/shopify-api-js#532

jakeleventhal commented 1 year ago

I'm seeing that many fields are incorrectly typed. For instance on Order, line_items is incorrect, and most fields are nullable even though there is no way that is possible.

I guess the team is trying to consider the case where the user uses the fields parameter, but even so, in that case the user should then just use Pick<Order, 'fields' | 'that' | 'user' | 'selects'>

magoz commented 1 year ago

I'm experiencing the same. Also, Shopify/shopify-app-js#773 is related.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.

jakeleventhal commented 1 year ago

Not stale

neeler commented 10 months ago

Experiencing the same issue.

max-sym commented 9 months ago

Same here. Is there going to be a fix for this?

github-actions[bot] commented 7 months ago

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.

jakeleventhal commented 7 months ago

Not stale

paulomarg commented 5 months ago

Hey folks. First of all, let me say sorry for our lack of responsiveness on this issue - we didn't properly track it, so we didn't have enough visibility on it.

There are a few things to consider when talking about the types for the REST classes. The types in the fields are more flexible than they need to be for a few reasons:

The above are the main reasons why some of the fields' types might seem a bit strange. All of that being said, though, if you do find instances where the types are wrong and make it impossible to use a resource, please do call them out and we'll fix them.

Again, thank you for your patience, and thank you for helping improve our packages!

github-actions[bot] commented 3 months ago

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.