Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Product media_gallery_entries / types only present if image, thumbnail, small_image is requested #612

@mhaack

Description

@mhaack

A query for media_gallery_entries / types of a product should always return the correct types of a gallery asset entry. This is currently broken, types are only returned if image, thumbnail, small_image are requested as well. Tested with 2.3.1.

Preconditions (*)

Tested with 2.3.1.

Steps to reproduce (*)

Query 1:

{
  products(filter: {url_key: {eq: "simple-product-23308"}}) {
    items {
      name
      sku
      id
      url_key
      image {
        url
      }
      thumbnail {
        url
      }
      small_image {
        url
      }
      media_gallery_entries {
        id
        file
        types
      }
    }
  }
}

Result: types are present in the response

Query 2:

{
  products(filter: {url_key: {eq: "simple-product-23308"}}) {
    items {
      name
      sku
      id
      url_key
      media_gallery_entries {
        id
        file
        types
      }
    }
  }
}

Result: types are missing in the response, arrays are all empty. For example:

{
  "data": {
    "products": {
      "items": [
        {
          "name": "Simple Product 23308",
          "sku": "product_dynamic_23308",
          "id": 23314,
          "url_key": "simple-product-23308",
          "media_gallery_entries": [
            {
              "id": 520,
              "file": "/f/7/f7e6c85504ce6e82442c770f7c8606f0.jpg",
              "types": []
            },
            {
              "id": 523,
              "file": "/b/f/bf8229696f7a3bb4700cfddef19fa23f.jpg",
              "types": []
            },
            {
              "id": 526,
              "file": "/8/2/82161242827b703e6acf9c726942a1e4.jpg",
              "types": []
            }
          ]
        }
      ]
    }
  }
}

Expected result (*)

The media_gallery_entries - types array is correct, also if one does not explicitly query for image, thumbnail or small_image.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions