3

I have a problem with a graphql query which includes an asset field. The asset field is always an empty array. There are no errors in the graphiql tool.

The graphql api is not public unfortunately but if anyone has any ideas on how I could troubleshoot that would be appreciated.

The query itself is pretty simple:

{
   entries(section: "posts") {
        title
        ... on posts_posts_Entry {
            testText
            imagetest {
                id
            }
        }
    }
}

Response:

{
  "data": {
    "entries": [
      {
        "title": "Headline",
        "testText": "testing",
        "model": [ ]
      }
    ]
  }
}
2

Check that the schema you're querying has permissions to access the asset volumes that your asset field is pulling from.

For images to be returned, the schema you are querying must have permissions for every asset volume that your asset field can pull from. If there are any assets selected in the field which the schema does not have permission to access, then the field will return an empty array.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.