Skip to main content

products

Overview

Fetch a paginated list of products. You can tailor the returned fields according to your UI needs.

Query

query FindAllProducts($input: GetAllProductsInput) {
findAllProducts(input: $input) {
success
message
data {
_id
title
slug
description
app
tags
status
publishedAt
images {
_id
fileUrl
}
collections {
_id
app
title
slug
description
operation
image {
_id
fileUrl
}
}
seo {
title
description
keywords
image
canonicalUrl
}
pricing {
compareAtPrice
originalPrice
price
}
variantsCount
dimensions {
height
width
unit
}
weight {
weight
unit
}
variants {
_id
product
options {
_id
option { name }
label
type
sortOrder
createdAt
updatedAt
}
images { _id fileUrl }
pricing { originalPrice price compareAtPrice }
quantity
weight { unit weight }
}
options {
_id
product
valuesCount
values {
_id
label
type
sortOrder
createdAt
updatedAt
}
name
createdAt
updatedAt
}
}
pagination {
total
page
limit
totalPages
}
}
}

Variables

{
"input": {
"page": 1,
"limit": 20
// Add optional filters/sorting if your API supports them
}
}

Examples

curl -X POST \
https://subdomain.com \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{
"query": "query FindAllProducts($input: GetAllProductsInput) { findAllProducts(input: $input) { success message data { _id title slug } pagination { total page limit totalPages } } }",
"variables": { "input": { "page": 1, "limit": 20 } }
}
EOF

Notes

  • Replace <TOKEN> with a valid token.
  • Add/remove fields within data and pagination according to what you render.
  • If GetAllProductsInput supports filters (e.g., text, collection, tags, status), pass them inside input.