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

collections

نظرة عامة

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

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

Query

query FindAllCollections($input: GetAllCollectionsInput) {
findAllCollections(input: $input) {
success
message
data {
_id
title
slug
description
operation
image {
# أضف الحقول التي تحتاجها، مثل url, alt
}
}
pagination {
# أضف الحقول التي تحتاجها، مثل page, limit, total, pages
}
}
}

المتغيرات

{
"input": {
"page": 1,
"limit": 20
}
}

أمثلة

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

ملاحظات

  • استبدل <TOKEN> برمز صالح.
  • أضف الحقول الدقيقة التي تحتاجها داخل image {} و pagination {}.
  • إذا كان API الخاص بك يفرض مرشحات معينة في GetAllCollectionsInput، أضفها تحت input وفقاً لذلك.