Код: Выделить всё
{
"name": "Intros",
"description": "Inserted into existing pages",
"displayField": "title",
"fields": [
{
"id": "title",
"name": "Title",
"type": "Symbol",
"localized": false,
"required": true,
"validations": [],
"disabled": false,
"omitted": false
},
{
"id": "reviewStatus",
"name": "Review Status",
"type": "Symbol",
"localized": false,
"required": false,
"validations": [
{
"in": [
"Internal",
"Accepted"
]
}
],
"disabled": false,
"omitted": false
},
{
"id": "referencePages",
"name": "Reference Pages",
"type": "Array",
"localized": false,
"required": false,
"validations": [],
"disabled": false,
"omitted": false,
"items": {
"type": "Link",
"validations": [
{
"linkContentType": [
"application",
"activity",
"assessments",
"book",
"client",
"landing",
"list",
"onlineProgram",
"organization",
"person",
"podcast",
"topics",
"video"
]
}
],
"linkType": "Entry"
}
},
{
"id": "excludeClient",
"name": "Exclude Client",
"type": "Array",
"localized": false,
"required": false,
"validations": [],
"disabled": false,
"omitted": false,
"items": {
"type": "Link",
"validations": [
{
"linkContentType": [
"client"
]
}
],
"linkType": "Entry"
}
}
]
}
Код: Выделить всё
const ctfPayload = {
content_type: 'intros',
select:
'fields.referencePages,fields.client,fields.excludeClient,fields.commonPages,fields.header,fields.description,fields.url,fields.linkName,fields.style,fields.image,fields.multipleImages,fields.tags,fields.context',
'fields.reviewStatus': 'Accepted',
limit: 1000,
'fields.referencePages.sys.id': '7HizEUDWMMWA4EMkm8kcKS',
};
const response = await ctf.getEntries(ctfPayload);
< /code>
Итак, первые вопросы: если я использую GraphQL, чтобы сделать то же самое, я получил 0 элементов, что сбивает с толку, так как они точно одинаковы. < /p>
query {
introsCollection(
where: {
reviewStatus: "Accepted",
referencePages: {
sys: {
id: "7HizEUDWMMWA4EMkm8kcKS"
}
}
}
limit: 1000
) {
items {
title
}
total
}
}
Код: Выделить всё
const ctfPayload = {
content_type: 'intros',
select:
'fields.referencePages,fields.client,fields.excludeClient,fields.commonPages,fields.header,fields.description,fields.url,fields.linkName,fields.style,fields.image,fields.multipleImages,fields.tags,fields.context',
'fields.reviewStatus': 'Accepted',
limit: 1000,
'fields.referencePages.slug': 'calm',
};
const response = await ctf.getEntries(ctfPayload);
< /code>
Это ошибка, которую я получаю < /p>
{
"sys": {
"type": "Error",
"id": "InvalidQuery"
},
"message": "The query you sent was invalid. Probably a filter or ordering specification is not applicable to the type of a field.",
"details": {
"errors": [
{
"name": "unknown",
"path": [
"fields",
"referencePages",
"en-US",
"slug"
],
"details": "The path \"fields.referencePages.en-US.slug\" is not recognized"
}
]
},
"requestId": "8c86a826-0025-463c-8bcc-2a1bbb4955cd"
}
Подробнее здесь: https://stackoverflow.com/questions/796 ... -filtering