shopify-api-js
shopify-api-js copied to clipboard
[Suggestion] Documentation is not updated for new version of shopify-api
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.
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.
+1 for this as well
Would need it too, especially for handling pagination.
Would need it too, especially for handling pagination.
Did you ever figure out Rest pagination?
@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?
@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.
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.
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!