shopify-api-js icon indicating copy to clipboard operation
shopify-api-js copied to clipboard

[Suggestion] Documentation is not updated for new version of shopify-api

Open maruffahmed opened this issue 2 years ago • 6 comments

I feel like this documentation is outdated. The new shopify-api make everything easy. Example: This is the old method for make a rest API call for getting products

const session = await Shopify.Utils.loadCurrentSession(req, res);
const client = new Shopify.Clients.Rest(session.shop, session.accessToken);
// All products
const products = await client.get({
  path: 'products',
});

Now It is easy and straightforward like bellow, even we could get anything at the same time

const session = await Shopify.Utils.loadCurrentSession(req, res, true);
 const { Product, Theme} = await import(
    `@shopify/shopify-api/dist/rest-resources/2022-04/index.js`
  );
// All products
const products = Product.all({session})

// Thme
const themes = Theme.all({session})
const mainTheme = themes.find((theme) => theme.role === "main");

I got confused by the documentation so I wish it to be updated.

maruffahmed avatar Jun 03 '22 17:06 maruffahmed

I would also really like to see this. I've had trouble getting the new way working and would like to see the full implementation.

charle-connoringold avatar Jun 13 '22 08:06 charle-connoringold

+1 for this as well

PurplePineapple123 avatar Jun 29 '22 21:06 PurplePineapple123

Would need it too, especially for handling pagination.

l-portet avatar Jul 12 '22 09:07 l-portet

Would need it too, especially for handling pagination.

Did you ever figure out Rest pagination?

PurplePineapple123 avatar Jul 23 '22 17:07 PurplePineapple123

@maruffahmed This is huge, their documentation is still showing the old way months later. Can you tell me where you found this new way of querying data?

limeforadime avatar Sep 20 '22 22:09 limeforadime

@maruffahmed This is huge, their documentation is still showing the old way months later. Can you tell me where you found this new way of querying data?

I read there new app template code and found this. Also here is some updates documentation i found https://shopify.dev/api/admin-rest/2022-07/resources/theme I must say their app template is not stable. App structure is changing so rapidly.

maruffahmed avatar Sep 21 '22 03:09 maruffahmed

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.

github-actions[bot] avatar Nov 21 '22 02:11 github-actions[bot]

We are closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!

github-actions[bot] avatar Dec 06 '22 02:12 github-actions[bot]