انتقل إلى المحتوى الرئيسي

products

نظرة عامة

اجلب قائمة مُرقمة من المنتجات. يمكنك تخصيص الحقول المُعادة وفقاً لاحتياجات واجهتك.

  • النوع: GraphQL Query
  • Endpoint: https://subdomain.com
  • المصادقة: Authorization: Bearer <TOKEN>

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
}
}
}

المتغيرات

{
"input": {
"page": 1,
"limit": 20
// أضف مرشحات/ترتيب اختياري إذا كان API الخاص بك يدعمها
}
}

أمثلة

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

ملاحظات

  • استبدل <TOKEN> برمز صالح.
  • أضف/احذف الحقول داخل data و pagination وفقاً لما تعرضه.
  • إذا كان GetAllProductsInput يدعم المرشحات (مثل النص، المجموعة، الوسوم، الحالة)، مررها داخل input.