I have a document that looks like this:
{
"id": "YVFtzxEAACMAUusa",
"uid": "abcde",
"first_publication_date": "2021-09-27T07:08:03+0000",
"last_publication_date": "2022-08-16T15:04:20+0000",
"data": {
"specialisations": [
{
"specialization": {
"id": "Ye2kTxMAACMAfe9X",
"type": "specialisation",
"tags": [],
"lang": "ro",
"slug": "-",
"first_publication_date": "2022-01-23T18:54:13+0000",
"last_publication_date": "2024-03-06T13:09:27+0000",
"uid": "specialization-one",
"link_type": "Document",
"isBroken": false
}
}
]
}
}
As you can see, my document called "helper" contains a group field, called "specialisations", and in each group field I have a field called "specialization" (notice the "z") which is a link to another document of type "specialisation.
I am now using graphQuery
in order to obtain the fields, and here is how I am using it:
const helpers = await client.getAllByType("helper", {
graphQuery: `{
helpers {
specialisations {
specialization {
...on specialisation {
...specialisationFields
}
}
}
}
}`,
});
No matter how I try I don't get the related document fields. This is how the console log looks like:
"specialisations": [
{
"specialization": {
"id": "Ye2kTxMAACMAfe9X",
"type": "specialisation",
"tags": [],
"lang": "ro",
"slug": "-",
"first_publication_date": "2022-01-23T18:54:13+0000",
"last_publication_date": "2024-03-06T13:09:27+0000",
"uid": "cardiologie-interventionala",
"link_type": "Document",
"isBroken": false
}
}
]
As you can see the "data" property is missing....