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

citiesByCountry

نظرة عامة

اجلب قائمة المدن التي تنتمي إلى دولة معينة.

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

Query

query FindAllCitiesByCountry($countryId: ID!) {
findAllCitiesByCountry(countryId: $countryId) {
success
message
data {
_id
name
description
active
deleted
country {
_id
name
image { image imageUrl }
code
continent
capital
active
deleted
phonekey
createdAt
updatedAt
}
}
}
}

المتغيرات

{
"countryId": "<COUNTRY_ID>"
}

أمثلة

curl -X POST \
https://subdomain.com\
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{
"query": "query FindAllCitiesByCountry($countryId: ID!) { findAllCitiesByCountry(countryId: $countryId) { success message data { _id name } } }",
"variables": { "countryId": "<COUNTRY_ID>" }
}
EOF

ملاحظات

  • استبدل <TOKEN> و <COUNTRY_ID> بقيم صالحة.
  • يمكنك توسيع الحقول المحددة تحت data حسب الحاجة (مثل description، active).