Closed lacabra-dev closed 1 year ago
I can't reproduce.
$ cat index.mjs
import Shopify from 'shopify-api-node';
const shopify = new Shopify({
shopName: 'quuz',
apiVersion: '2023-01',
apiKey: 'b68c3a4bf44cd240511e5f4114f0be4d',
password: '2d170167fc62551920ca60fe40a5e548'
});
const products = await shopify.product.list();
console.log(products);
$ node index.mjs
[]
Are you sure that product.id
in your example matches an existing product?
Thanks for the prompt response ! :)
What if it doesnt? I'll check shortly, but I mean if I query for a product and it cant find it, I'd expect the return to be an empty array just like the .list(), why would it be a 404?
why would it be a 404?
Because 404 is what the API returns for something that does not exist. That is APIs standard behavior.
I'm closing this as answered.
Hi everyone
why can I do the following
shopifyStore.product .get(product.id) .then((result) => { console.log(result); }) .catch((error) => { console.error(error); });
But I cannot do this:
const result = await shopifyStore.product.get(product.id);
? I getnode_modules/got/dist/source/as-promise/index.js:118 request._beforeError(new types_1.HTTPError(response)); ^ HTTPError: Response code 404 (Not Found)