Image Gallery - How to do it?

I’m currently trying to create an image gallery (with categories), however, I’m wondering what the best way to go about this is.

Attempt 1: Two Collection-Types (Gallery Categories & Gallery Images). This works in principle, but the images have to be uploaded/added individually (one by one).

Attempt 2: One Single-Type (Galleries) with one field “Images”. This also works in principle and you can upload/add multiple images at once. Problem: With the GraphQL query I use, I never retrieve more than 10 images per gallery:

query Galleries {
  galleries {
    data {
      id
      attributes {
        title
        slug
        description
        displayMode
        previewImage {
          data {
            attributes {
              name
              alternativeText
              width
              height
              url
              formats
            }
          }
        }
        images {
          data {
            attributes {
              image {
                data {
                  attributes {
                    name
                    alternativeText
                    width
                    height
                    url
                    formats
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

What is the best way to solve this?

On the overview page, I need to know, how many images have been added to the galleries, and on the gallery page, I need all images for a given gallery, and not limited to 10 items.

Follow up: I found a solution for my problem. The images property supports pagination, so to get all images, I simply had to replace

images {

with:

images(pagination: { limit: -1 }) {

However, if there’s an easier way to get the number of images (except read out all the images and then count them together, which is what I’m currently doing), please let me know :slight_smile: