Similar to this topic, can anyone offer some insight into how to query for content relationship documents within group fields?
I have a custom type with repeatable groups which contain a content relationship field. I am able to query these fields using fetchLinks, but like the linked topic above, fetchLinks only returns the first object in a Rich Text field's array.
JSON for the about_page custom type:
{
"id": "about_page",
"label": "About Page",
"repeatable": false,
"status": true,
"json": {
"Main": {
"uid": {
"type": "UID",
"config": {
"label": "Slug",
"placeholder": ""
}
},
"page_title": {
"type": "StructuredText",
"config": {
"label": "Page Title",
"placeholder": "",
"allowTargetBlank": true,
"single": "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl"
}
},
"page_content": {
"type": "StructuredText",
"config": {
"label": "Page Content",
"placeholder": "",
"allowTargetBlank": true,
"multi": "paragraph,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl"
}
},
"section": {
"type": "Group",
"config": {
"label": "Section",
"fields": {
"section_id": {
"type": "Text",
"config": {
"label": "Section ID",
"placeholder": ""
}
},
"section_title": {
"type": "Text",
"config": {
"label": "Section Title",
"placeholder": ""
}
},
"section_content": {
"type": "StructuredText",
"config": {
"label": "Section Content",
"placeholder": "",
"allowTargetBlank": true,
"multi": "paragraph,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item"
}
},
"content_relationship": {
"type": "Link",
"config": {
"label": "Content Relationship",
"select": "document"
}
}
}
}
},
"slices": {
"type": "Slices",
"fieldset": "Slice Zone",
"config": {
"choices": {
"call_to_action": {
"type": "SharedSlice"
},
"content_relationship": {
"type": "SharedSlice"
},
"rich_text_slice": {
"type": "SharedSlice"
},
"three_card_block": {
"type": "SharedSlice"
},
"multiple_button_call_to_action": {
"type": "SharedSlice"
}
}
}
}
}
}
}
JSON for meeting_tabs custom type:
{
"id": "meeting_tabs",
"label": "Meeting Tabs",
"repeatable": false,
"status": true,
"json": {
"Main": {
"uid": {
"type": "UID",
"config": {
"label": "meeting-tabs",
"placeholder": ""
}
},
"upcoming_meeting_date": {
"type": "Date",
"config": {
"label": "Upcoming Meeting Date",
"placeholder": ""
}
},
"upcoming_meeting_agenda_packet": {
"type": "Link",
"config": {
"label": "Upcoming Meeting Agenda Packet",
"placeholder": "",
"select": null
}
},
"upcoming_meeting_agenda_content": {
"type": "StructuredText",
"config": {
"label": "Upcoming Meeting Agenda Content",
"placeholder": "",
"allowTargetBlank": true,
"multi": "paragraph,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item"
}
},
"previous_meeting_date": {
"type": "Date",
"config": {
"label": "Previous Meeting Date",
"placeholder": ""
}
},
"previous_meeting_documents": {
"type": "Group",
"config": {
"label": "Previous Meeting Documents",
"fields": {
"document_title": {
"type": "Text",
"config": {
"label": "Document Title",
"placeholder": ""
}
},
"document_link": {
"type": "Link",
"config": {
"label": "Document Link",
"placeholder": "",
"select": "media"
}
}
}
}
}
}
}
}
This query is not returning any of the subfields for the meeting_tabs custom type:
async function init() {
const page = await client.getByUID('about_page', 'about-meetings',
{
graphQuery: `{
section {
meeting_tabs {
...on meeting_tabs {
...meeting_tabsFields
}
}
}
}`
}
)
return page
}
init()