MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
947 stars 278 forks source link

[ts] Add admin_graphql_api_id to ts types #595

Closed peterz0 closed 1 year ago

peterz0 commented 1 year ago

Add admin_graphql_api_id to IOrder, ICustomer and IProduct. This field is documented in the response example of the doc [1][2][3]

Ref:

  1. https://shopify.dev/docs/api/admin-rest/2023-04/resources/customer
  2. https://shopify.dev/docs/api/admin-rest/2023-04/resources/order
  3. https://shopify.dev/docs/api/admin-rest/2023-04/resources/product
coveralls commented 1 year ago

Coverage Status

Coverage: 100.0%. Remained the same when pulling f63aed10588308a2dbe91001344565e8d7ee00e1 on peterz0:master into 0b7dc2b0daf9cac5e2b68515a358cf3599a9028c on MONEI:master.

lpinca commented 1 year ago

There are many more resources that have the admin_graphql_api_id property in the HTTP response data. I would prefer to not add it because:

  1. It is not officially documented.
  2. The interface is usually used for both the HTTP request and response body.
peterz0 commented 1 year ago

The problem we want to solve is that we have a customer json of Shopify.ICustomer type (e.g. from customers webhook). Then we want to use admin_graphql_api_id for graphql API call. However, we face type error because admin_graphql_api_id isn't in the ICustomer interface. Do you have any advise on it? Thanks!

lpinca commented 1 year ago

Not really. How about making the property optional and adding it to all resources where it exists?

peterz0 commented 1 year ago

Thanks! Let me close the pr at the moment.