Hi,
First a little of background informations:
We're using the REST API v2 via @prismicio/client to fetch the documents.
We have two Models (Event & EventCategory).
# Event
- title: StructuredText
- category: Link<EventCategory>
# EventCategory
- name: key StructuredText
In our Page we have a slice, which references to an Event.
The parameter for the query of the page looks like this:
The important part is event_category.name
{
client: Client(),
uid: () => 'home',
lang: 'de-li',
params: {
fetchLinks: [
'event.title',
'event.category',
'event_category.name'
],
}
and here is the result:
{
"props": {
"id": "YLdQjxMAACMAOv1U",
"uid": "home",
"url": "/home",
"type": "page",
// ...
"data": {
// ...
"body": [
{
"slice_type": "event_category_teaser",
"slice_label": null,
"version": "sktwi1xtmkfgx8626",
"variation": "default-slice",
"primary": {
"eyebrow": "Test",
"title": []
// ...
},
"items": [
{
"event": {
"id": "YKPBXxIAACAAiSE8",
"type": "event",
"tags": [],
"slug": "lgt-academy.",
"lang": "de-li",
"uid": "lgt-academy",
"data": {
"title": [
{
"type": "heading1",
"text": "LGT Academy.",
"spans": []
}
],
"category": {
"id": "YKPBdhIAACIAiSGk",
"type": "event_category",
"tags": [],
"slug": "curriculum",
"lang": "de-li",
"uid": "curriculum",
"link_type": "Document",
"isBroken": false
}
},
"link_type": "Document",
"isBroken": false
}
},
{
"event": {
"id": "YKPYfxIAACEAiWWw",
"type": "event",
"tags": [],
"slug": "drive4impact.",
"lang": "de-li",
"uid": "drive4impact",
"data": {
"title": [
{
"type": "heading1",
"text": "Drive4Impact.",
"spans": []
}
],
"category": {
"id": "YFG8kBIAACQADbd6",
"type": "event_category",
"tags": [],
"slug": "seminar",
"lang": "de-li",
"uid": "seminar",
"link_type": "Document",
"isBroken": false
}
},
"link_type": "Document",
"isBroken": false
}
}
]
}
]
},
"error": null,
"slices": [
{
"slice_type": "event_category_teaser",
"slice_label": null,
"version": "sktwi1xtmkfgx8626",
"variation": "default-slice",
"primary": {
"eyebrow": "Test",
"title": [],
// ...
},
"items": [
{
"event": {
"id": "YKPBXxIAACAAiSE8",
"type": "event",
"tags": [],
"slug": "lgt-academy.",
"lang": "de-li",
"uid": "lgt-academy",
"data": {
"title": [
{
"type": "heading1",
"text": "LGT Academy.",
"spans": []
}
],
"category": {
"id": "YKPBdhIAACIAiSGk",
"type": "event_category",
"tags": [],
"slug": "curriculum",
"lang": "de-li",
"uid": "curriculum",
"link_type": "Document",
"isBroken": false
// <--- data is missing
}
},
"link_type": "Document",
"isBroken": false
}
},
{
"event": {
"id": "YKPYfxIAACEAiWWw",
"type": "event",
"tags": [],
"slug": "drive4impact.",
"lang": "de-li",
"uid": "drive4impact",
"data": {
"title": [
{
"type": "heading1",
"text": "Drive4Impact.",
"spans": []
}
],
"category": {
"id": "YFG8kBIAACQADbd6",
"type": "event_category",
"tags": [],
"slug": "seminar",
"lang": "de-li",
"uid": "seminar",
"link_type": "Document",
"isBroken": false
// <--- data is missing
}
},
"link_type": "Document",
"isBroken": false
}
}
]
}
]
}
}
As we can see, the event in the slice is correctly rendered with his properties title and category, but the category itself does not have the data attribute where we would find the name as we would expect.
We believe it was working a few days ago (We still have a version of the webpage, which includes the category data)
Did anything on the api change?
Is it the expected behaviour? If so, how do we get the properties of the category?
Thanks for your help.
Best
Alex