---
title: "How to Get Products Upto 250 Without Pagination in Shopify Remix App?"
url: "https://magecomp.com/blog/get-products-upto-250-without-pagination-in-shopify-remix-app/"
date: "2024-06-25T17:32:47+00:00"
modified: "2025-01-31T05:05:41+00:00"
author:
  name: "Bharat Desai"
  url: "https://magecomp.com"
categories:
  - "Remix"
  - "Shopify"
word_count: 334
reading_time: "2 min read"
summary: "In this blog post, we'll show you how to get products upto 250 without pagination in Shopify Remix app. We have found that getting all products from the store using API is very complex and if possi..."
description: "Learn how to fetch up to 250 products without pagination in your Shopify Remix app using Shopify's GraphQL API."
keywords: "Remix, Shopify"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Top 10 Shopify Plus Agency in India"
    url: "https://magecomp.com/blog/shopify-plus-agency-india/"
  - title: "Top Shopify Bundle Apps for Higher Conversions"
    url: "https://magecomp.com/blog/top-shopify-bundle-apps/"
  - title: "Mastering CHARGIFY: The Ultimate Guide to Product Fee Surcharge"
    url: "https://magecomp.com/blog/guide-to-chargify-product-fee-surcharge/"
---

# How to Get Products Upto 250 Without Pagination in Shopify Remix App?

_Published: June 25, 2024_  
_Author: Bharat Desai_  

![How to Get Products Upto 250 Without Pagination in Shopify Remix App](https://magecomp.com/blog/wp-content/uploads/2024/06/How-to-Get-Products-Upto-250-Without-Pagination-in-Shopify-Remix-App-1024x512.webp)

In this blog post, we’ll show you how to get products upto 250 without pagination in Shopify Remix app. We have found that getting all products from the store using API is very complex and if possible then pagination is required for it, but we have another way to get it easily!
[![Shopify Mobile App Builder](https://magecomp.com/blog/wp-content/uploads/2024/12/Shopify-Mobile-App-Builder-3.webp)](https://apps.shopify.com/mobile-app-builder-by-magecomp)

**Prerequisites:**

Before proceeding, ensure that the user has the necessary permissions and write access scope to get products in the Shopify store.
## How to Get Products Upto 250 Without Pagination in Shopify Remix App?
We need to set code for getting all products without pagination which needs a cursor and GraphQL query to complete it. Here’s how you can do it:
```
import React from "react";
import { json } from "@remix-run/node";
import {useLoaderData} from "@remix-run/react";
import shopify from "../shopify.server";

export async function loader({ request }) {
    const { admin } = await shopify.authenticate.admin(request);
    const url = new URL(request.url);
    const searchParam = url.searchParams;
    const initialCursor = searchParam.get("cursor");
    const pageSize = 250;
    let hasNextPage = true;
    let products = [];
    const fetchProductPage = async (cursor) => {
    const graphqlString = `
    {
           products(first: ${pageSize}${cursor ? `, after: "${cursor}"` : ""}) {
                  pageInfo {
                         endCursor
                         hasNextPage
                  }
                  nodes {
                           id
                           title
                           status
                           vendor
                           totalInventory
                  }
         }
}`;

const response = await admin.graphql(graphqlString);
const result = await response.json();
     if (result.errors) {
         throw new Error(
             `GraphQL request failed: ${JSON.stringify(result.errors)}`
          );
      }
      products = products.concat(result.data.products.nodes);
      hasNextPage = result.data.products.pageInfo.hasNextPage;

      return result.data.products.pageInfo.endCursor;
};
const cursors = [];
let currentCursor = initialCursor;

while (hasNextPage) {
        currentCursor = await fetchProductPage(currentCursor);
        cursors.push(currentCursor);
}
return json({ products,cursors,});
}

export default function Index() {
     const { products } = useLoaderData();
     console.log(products);
      return (
           <></>
       );
}
```

This code works for getting all products using GraphQL query and now you can use all products at any place you want.
[![Hire Shopify Developers](https://magecomp.com/blog/wp-content/uploads/2024/12/Hire-Shopify-Developers-png.webp)](https://magecomp.com/services/expert-shopify-developers/)

**Output:**

Here is a screenshot given below that shows received products from GraphQL query.
![get products without pagination](https://magecomp.com/blog/wp-content/uploads/2024/06/get-products-without-pagination.png)

## Conclusion:
Getting products without pagination is a very useful thing to get updated and synchronized with all your products. For that reason, you can handle all your stores using just a single GraphQL query.
[![Shopify SEO](https://magecomp.com/blog/wp-content/uploads/2024/12/Shopify-SEO-png.webp)](https://magecomp.com/services/shopify-seo/)

**Happy Coding!**


---

_View the original post at: [https://magecomp.com/blog/get-products-upto-250-without-pagination-in-shopify-remix-app/](https://magecomp.com/blog/get-products-upto-250-without-pagination-in-shopify-remix-app/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-26 03:13:38 UTC_  
