1

Consider the following GraphQL query:

{
  entries {
    ...on posts_default_Entry {
      image {
        id
      }
    }
  }
}

This will return the following:

{
  "data": {
    "entries": [
      {
        "image": [
          {
            "id": "11010"
          }
        ]
      }
    ]
  }
}

However, since the image field is limited to 1 image, it doesn't make sense for it to be an array. I would prefer that the query returned the following instead:

{
  "data": {
    "entries": [
      {
        "image": {
          "id": "11010"
        }
      }
    ]
  }
}

Is this possible?

1 Answer 1

2

No, I don't think so. If you think about it, assets are always an array so treat them consistently as such, even if you've set a limit of one. If the backend limit changes, it won't screw with your setup, either.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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