Sir please make a video on how to use external api call in Shopify functions
@fayyazraza315
2 ай бұрын
yes that will be covered in this playlist
@onlyreaction01
2 ай бұрын
@@fayyazraza315 sir please first cover this topic first because I am facing issue last 1-2 months
@bestmotivationspeekar4384
26 күн бұрын
how can fill inputs in fronted and show like stroe front uasing theme app extension uasing custum api or CRUD ??
@fayyazraza315
26 күн бұрын
I will make video on that
@bestmotivationspeekar4384
26 күн бұрын
@@fayyazraza315 thanks
@shahzmalik
Ай бұрын
I am having hard time working on the pagination of products list. I noticed we can only make request to the Shopify GraphQl API from the LoaderFunction and not from the client side. Do you have any videos upload related to this case where we can send request to shopify graphql from client side or how can I retrieve products list iteratively based on clicks. It will be a great help for me. Thanks!
@fayyazraza315
Ай бұрын
yes only server side
@shahzmalik
Ай бұрын
@@fayyazraza315 Thanks for your reply. So for the pagination, should I store all the products of the store in the database by making the initial server side request to Shopify graphQl api and retrieve those products from database for pagination purposes?
@fayyazraza315
Ай бұрын
@@shahzmalik To handle pagination with the Shopify GraphQL API directly, you don't necessarily need to store all products in a database. Shopify's GraphQL API provides a built-in mechanism for paginating through results using cursors. query getProducts($first: Int!, $after: String) { products(first: $first, after: $after) { edges { node { id title handle ... } cursor } pageInfo { hasNextPage hasPreviousPage } } } Variables: { "first": 10, "after": null } Example: { "first": 10, "after": "eyJvIjoib2Zmc2V0Ijo3LCJzIjoicHJvZHVjdHMvMzUyNzU1MTQ0ODMyIn0=" } Example loop let hasNextPage = true let after = null while (hasNextPage) { const response = await shopifyGraphQLQuery(first, after) storeProductsInDatabase(response.data.products.edges) hasNextPage = response.data.products.pageInfo.hasNextPage after = response.data.products.edges[response.data.products.edges.length - 1].cursor }
@shahzmalik
Ай бұрын
@@fayyazraza315 Hi Fayyaz, thanks for your response. What I understood is in your initial request to Shopify graphql API, you ran a loop where it's fetching all list of products based on cursors and then storing it in the database. Is this correct? If yes, Don't you think it's a bad idea to load all the list of products either in database or variable and then use that to display for pagination purposes? as I believe loading all products on server side with that loop will slower the speed of initial load of page.
@fayyazraza315
Ай бұрын
@@shahzmalik YOu can fetch all the products and save them into json file and then you can do the pagination on the client side
@shahzmalik
Ай бұрын
Can you please help me add the icon or app logo to my shopify app next to my app's name. How do I achieve this?
@fayyazraza315
Ай бұрын
you can upload app logo from shopify partner
@shahzmalik
Ай бұрын
@@fayyazraza315 Thanks Fayyaz! Wish you a good luck with your channel.
Пікірлер: 17