I've got a matrix field with a "Tags" field inside:
I'm using CraftQL to fetch all fields within this entry and generally it works really well, except for that Tags field.
When I run the below query in the CraftQL console in the admin panel, theBasicsIndustries returns an array of tags, as expected.
query StoryQuery($slug: String!) {
entry(siteId: 2, slug: $slug) {
... on StoriesStory {
id
contentBlock {
... on ContentBlockTheBasics {
__typename
id
theBasicsName
theBasicsIndustries {
id
title
}
}
}
}
}
}
Produces:
{
"data": {
"entry": {
"id": 26,
"contentBlock": [
{
"__typename": "ContentBlockTheBasics",
"id": "112",
"theBasicsName": "Some name",
"theBasicsIndustries": [
{
"id": 108,
"title": "Hospitality"
},
{
"id": 109,
"title": "Technology"
}
]
}
]
}
}
}
However when I run the same exact query through the API, it returns
Cannot query field "theBasicsIndustries" on type "ContentBlockTheBasics".
Thank you!
This is rather silly, but the problem was caused by a missing permission in CraftQL settings!
The token I was using didn't have the Query any tag
access.