From a85778679e99c40421b3be0122d153f991efbc80 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 11 Nov 2025 17:25:39 +0200 Subject: [PATCH] fix(product, types): add missing types for variant images and thumbnails (#14026) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary **What** — What changes are introduced in this PR? - Add missing `images` field of variants to the HTTP types - Add missing `thumbnail` field to product variant schema, which leads to the thumbnail missing from auto generated types **Why** — Why are these changes relevant or necessary? *Please provide answer here* **How** — How have these changes been implemented? *Please provide answer here* **Testing** — How have these changes been tested, or how can the reviewer test the feature? *Please provide answer here* --- ## Examples Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice. This helps with documentation and ensures maintainers can quickly understand and verify the change. ```ts // Example usage ``` --- ## Checklist Please ensure the following before requesting a review: - [ ] I have added a **changeset** for this PR - Every non-breaking change should be marked as a **patch** - To add a changeset, run `yarn changeset` and follow the prompts - [ ] The changes are covered by relevant **tests** - [ ] I have verified the code works as intended locally - [ ] I have linked the related issue(s) if applicable --- ## Additional Context Add any additional context, related issues, or references that might help the reviewer understand this PR. --- .changeset/warm-groups-lay.md | 6 ++++++ packages/core/types/src/http/product/admin/entitites.ts | 5 ----- packages/core/types/src/http/product/common.ts | 4 ++++ packages/modules/product/src/schema/index.ts | 1 + 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 .changeset/warm-groups-lay.md diff --git a/.changeset/warm-groups-lay.md b/.changeset/warm-groups-lay.md new file mode 100644 index 0000000000..4d96114102 --- /dev/null +++ b/.changeset/warm-groups-lay.md @@ -0,0 +1,6 @@ +--- +"@medusajs/product": patch +"@medusajs/types": patch +--- + +fix(product, types): add missing types for variant images and thumbnails diff --git a/packages/core/types/src/http/product/admin/entitites.ts b/packages/core/types/src/http/product/admin/entitites.ts index 13b8951a0c..568d314ca3 100644 --- a/packages/core/types/src/http/product/admin/entitites.ts +++ b/packages/core/types/src/http/product/admin/entitites.ts @@ -59,11 +59,6 @@ export interface AdminProductVariant extends BaseProductVariant { * The variant's inventory items. */ inventory_items?: AdminProductVariantInventoryItemLink[] | null - - /** - * The variant's images. - */ - images?: AdminProductImage[] | null } export interface AdminProductOption extends BaseProductOption { /** diff --git a/packages/core/types/src/http/product/common.ts b/packages/core/types/src/http/product/common.ts index da19e06ffb..d966b4c382 100644 --- a/packages/core/types/src/http/product/common.ts +++ b/packages/core/types/src/http/product/common.ts @@ -163,6 +163,10 @@ export interface BaseProductVariant { * The variant's thumbnail. */ thumbnail: string | null + /** + * The variant's images. + */ + images: BaseProductImage[] | null /** * Whether the variant can be ordered even if it's out of stock. */ diff --git a/packages/modules/product/src/schema/index.ts b/packages/modules/product/src/schema/index.ts index 8696dc5155..53a1a8b994 100644 --- a/packages/modules/product/src/schema/index.ts +++ b/packages/modules/product/src/schema/index.ts @@ -60,6 +60,7 @@ type ProductVariant { width: Float options: [ProductOptionValue!]! images: [ProductImage!]! + thumbnail: String metadata: JSON product: Product product_id: String