Issues with Typescript defintions in Shopify-api-node lib

asoola
Tourist
14 0 1

Hi,

There seems to be a few issues with the typescript definitions in shopify-api-node. For reference, I'm looking at the graphql docs.

I'll outline a few that exist for IOrder.

1.  billing_address is set to required, whereas the docs specify that

"Not all orders have mailing addresses" 

Ideally, we'd have
billing_address?:ICustomerAddress
instead of the current
billing_address: ICustomerAddress 

2. client_details is set to required
According to your docs, order has no field client_details

3. shipping_address is to required

However, the value can be null. Ideally we'd have
shipping_address?:ICustomerAddress

4. Docs specify the existence of currentCartDiscountAmountSet

IOrder Typescript definition lacks it

5. Cancel_reason set to required, but according to docs

"Reason the order was canceled. Returns null if the order wasn't canceled."

I suggest cancel_reason: OrderCancelReason | null;

 

 

Am I mistaken here? If not, will those definitions be updated soon?

I also noticed that the definitions lack admin_graphql_api_id, why? Shouldn't they be there?

0 Likes
_JCC_
Shopify Staff
Shopify Staff
158 21 27

@asoola

This npm package shopify-api-node  is an open source package not released from Shopify. While I suspect some of the developer community might find your post here, I would recommend creating an issue in the repository linked to the npm package.

Regards,

John

John C | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes