Open jakeleventhal opened 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'>
I'm experiencing the same. Also, Shopify/shopify-app-js#773 is related.
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.
Not stale
Experiencing the same issue.
Same here. Is there going to be a fix for this?
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.
Not stale
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 reason why fields can be of type Resource | {[key:string]: any}
is because when setting a value for example for a PUT or POST request, you wouldn't necessarily have to create an entirely new object. For instance, you can create a Product
whose variants
field is an array of hashes, like
const product = new Product();
product.variants = [{price: 10}];
and when saving that data we'll handle the conversion.
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!
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.
Reopening Shopify/shopify-api-js#532