From 9e4d2df72fe9d50188e56670a96f79dace45d1ae Mon Sep 17 00:00:00 2001 From: Nicolas Gorga <62995075+NicolasGorga@users.noreply.github.com> Date: Sun, 7 Dec 2025 16:03:25 -0300 Subject: [PATCH] fix(dashboard): avoid unnecessary product relations to be returned by default (#14175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary **What** — What changes are introduced in this PR? Improve Admin UI product detail performance after updating the entity. **Why** — Why are these changes relevant or necessary? Products with a lot of relations would cause issues when trying to be updated through various edit components, since the core update api route returns these entities by default. **How** — How have these changes been implemented? We remove these unnecessary relations when calling the update route, by passing the `fields` query param with the negation sign for each of these. For example: `fields=-type,-collection...` **Testing** — How have these changes been tested, or how can the reviewer test the feature? Tested all of the update components and validated they still work correctly, plus, none depend on the returned product to perform an action or render information. --- ## 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: - [x] 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** - [x] I have verified the code works as intended locally - [x] 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. fixes #13783, #14183 closes CORE-1296, SUP-2791 Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com> --- .changeset/tall-cycles-allow.md | 5 +++++ .../components/search/use-search-results.tsx | 4 +++- .../dashboard/src/hooks/api/products.tsx | 6 +++++- .../table/query/use-product-table-query.tsx | 3 ++- .../price-list-prices-form.tsx | 4 +++- .../price-list-prices-add-prices-form.tsx | 4 +++- .../price-list-prices-edit.tsx | 4 +++- .../product-variant-edit.tsx | 3 ++- .../product-attributes/product-attributes.tsx | 5 +++-- .../product-create-option.tsx | 6 +++++- .../product-create-variant.tsx | 5 ++++- .../products/product-detail/breadcrumb.tsx | 5 +++-- .../product-edit-option.tsx | 5 ++++- .../products/product-edit/product-edit.tsx | 5 +++-- .../product-image-variants-edit.tsx | 6 +++++- .../products/product-media/product-media.tsx | 5 ++++- .../product-metadata/product-metadata.tsx | 6 +++++- .../product-organization.tsx | 4 ++-- .../product-prices/product-prices.tsx | 5 ++++- .../product-sales-channels.tsx | 5 ++++- .../product-shipping-profile.tsx | 5 +++-- .../components/target-item/target-item.tsx | 6 +++++- .../tax-override-card/tax-override-card.tsx | 20 +++++++++---------- 23 files changed, 90 insertions(+), 36 deletions(-) create mode 100644 .changeset/tall-cycles-allow.md diff --git a/.changeset/tall-cycles-allow.md b/.changeset/tall-cycles-allow.md new file mode 100644 index 0000000000..c633c5057b --- /dev/null +++ b/.changeset/tall-cycles-allow.md @@ -0,0 +1,5 @@ +--- +"@medusajs/dashboard": patch +--- + +fix(dashboard): avoid unnecessary product relations to be returned by default diff --git a/packages/admin/dashboard/src/components/search/use-search-results.tsx b/packages/admin/dashboard/src/components/search/use-search-results.tsx index 41149d9bfa..0628041562 100644 --- a/packages/admin/dashboard/src/components/search/use-search-results.tsx +++ b/packages/admin/dashboard/src/components/search/use-search-results.tsx @@ -117,7 +117,9 @@ const useDynamicSearchResults = ( { q: debouncedSearch, limit, - fields: "id,title,thumbnail", + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "id,title,thumbnail,-type,-collection,-options,-tags,-images,-variants,-sales_channels", }, { enabled: isAreaEnabled(currentArea, "product"), diff --git a/packages/admin/dashboard/src/hooks/api/products.tsx b/packages/admin/dashboard/src/hooks/api/products.tsx index 58282568fc..f6fbb0f1be 100644 --- a/packages/admin/dashboard/src/hooks/api/products.tsx +++ b/packages/admin/dashboard/src/hooks/api/products.tsx @@ -340,7 +340,11 @@ export const useUpdateProduct = ( > ) => { return useMutation({ - mutationFn: (payload) => sdk.admin.product.update(id, payload), + mutationFn: (payload) => + sdk.admin.product.update(id, payload, { + fields: + "-type,-collection,-options,-tags,-images,-variants,-sales_channels", + }), onSuccess: async (data, variables, context) => { await queryClient.invalidateQueries({ queryKey: productsQueryKeys.lists(), diff --git a/packages/admin/dashboard/src/hooks/table/query/use-product-table-query.tsx b/packages/admin/dashboard/src/hooks/table/query/use-product-table-query.tsx index 2187a3c79c..9dada723d5 100644 --- a/packages/admin/dashboard/src/hooks/table/query/use-product-table-query.tsx +++ b/packages/admin/dashboard/src/hooks/table/query/use-product-table-query.tsx @@ -7,7 +7,8 @@ type UseProductTableQueryProps = { } const DEFAULT_FIELDS = - "id,title,handle,status,*collection,*sales_channels,variants.id,thumbnail" + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + "id,title,handle,status,*collection,*sales_channels,variants.id,thumbnail,-type,-options,-tags,-images,-variants" export const useProductTableQuery = ({ prefix, diff --git a/packages/admin/dashboard/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx b/packages/admin/dashboard/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx index 932222d3db..28f63b4834 100644 --- a/packages/admin/dashboard/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx +++ b/packages/admin/dashboard/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx @@ -35,7 +35,9 @@ export const PriceListPricesForm = ({ const { products, isLoading, isError, error } = useProducts({ id: ids.map((id) => id.id), limit: ids.length, - fields: "title,thumbnail,*variants", + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "title,thumbnail,*variants,-type,-collection,-options,-tags,-images,-sales_channels", }) const { setCloseOnEscape } = useRouteModal() diff --git a/packages/admin/dashboard/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-prices-form.tsx b/packages/admin/dashboard/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-prices-form.tsx index 513fdf8341..67c6bd10dd 100644 --- a/packages/admin/dashboard/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-prices-form.tsx +++ b/packages/admin/dashboard/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-prices-form.tsx @@ -36,7 +36,9 @@ export const PriceListPricesAddPricesForm = ({ const { products, isLoading, isError, error } = useProducts({ id: ids.map((id) => id.id), limit: ids.length, - fields: "title,thumbnail,*variants", + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "title,thumbnail,*variants,-type,-collection,-options,-tags,-images,-sales_channels", }) const { setValue } = form diff --git a/packages/admin/dashboard/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx b/packages/admin/dashboard/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx index 7f3910ffab..60c8e87c1c 100644 --- a/packages/admin/dashboard/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx +++ b/packages/admin/dashboard/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx @@ -22,7 +22,9 @@ export const PriceListPricesEdit = () => { id: productIds, limit: productIds?.length || 9999, // Temporary until we support lazy loading in the DataGrid price_list_id: [id!], - fields: "title,thumbnail,*variants", + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "title,thumbnail,*variants,-type,-collection,-options,-tags,-images,-sales_channels", }) const { isReady, regions, currencies, pricePreferences } = diff --git a/packages/admin/dashboard/src/routes/product-variants/product-variant-edit/product-variant-edit.tsx b/packages/admin/dashboard/src/routes/product-variants/product-variant-edit/product-variant-edit.tsx index 61394ea49c..fd240a0f3c 100644 --- a/packages/admin/dashboard/src/routes/product-variants/product-variant-edit/product-variant-edit.tsx +++ b/packages/admin/dashboard/src/routes/product-variants/product-variant-edit/product-variant-edit.tsx @@ -33,7 +33,8 @@ export const ProductVariantEdit = () => { } = useProduct( variant?.product_id!, { - fields: "-variants", + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: "-type,-collection,-tags,-images,-variants,-sales_channels", }, { enabled: !!variant?.product_id, diff --git a/packages/admin/dashboard/src/routes/products/product-attributes/product-attributes.tsx b/packages/admin/dashboard/src/routes/products/product-attributes/product-attributes.tsx index f7e2c1905c..63502fe866 100644 --- a/packages/admin/dashboard/src/routes/products/product-attributes/product-attributes.tsx +++ b/packages/admin/dashboard/src/routes/products/product-attributes/product-attributes.tsx @@ -4,7 +4,6 @@ import { useParams } from "react-router-dom" import { RouteDrawer } from "../../../components/modals" import { useProduct } from "../../../hooks/api/products" -import { PRODUCT_DETAIL_FIELDS } from "../product-detail/constants" import { ProductAttributesForm } from "./components/product-attributes-form" export const ProductAttributes = () => { @@ -12,7 +11,9 @@ export const ProductAttributes = () => { const { t } = useTranslation() const { product, isLoading, isError, error } = useProduct(id!, { - fields: PRODUCT_DETAIL_FIELDS, + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "-type,-collection,-options,-tags,-images,-variants,-sales_channels", }) if (isError) { diff --git a/packages/admin/dashboard/src/routes/products/product-create-option/product-create-option.tsx b/packages/admin/dashboard/src/routes/products/product-create-option/product-create-option.tsx index 3ad22b6714..89cd9f6828 100644 --- a/packages/admin/dashboard/src/routes/products/product-create-option/product-create-option.tsx +++ b/packages/admin/dashboard/src/routes/products/product-create-option/product-create-option.tsx @@ -9,7 +9,11 @@ export const ProductCreateOption = () => { const { id } = useParams() const { t } = useTranslation() - const { product, isLoading, isError, error } = useProduct(id!) + const { product, isLoading, isError, error } = useProduct(id!, { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "-type,-collection,-options,-tags,-images,-variants,-sales_channels", + }) if (isError) { throw error diff --git a/packages/admin/dashboard/src/routes/products/product-create-variant/product-create-variant.tsx b/packages/admin/dashboard/src/routes/products/product-create-variant/product-create-variant.tsx index d37b61060c..5c245b9e78 100644 --- a/packages/admin/dashboard/src/routes/products/product-create-variant/product-create-variant.tsx +++ b/packages/admin/dashboard/src/routes/products/product-create-variant/product-create-variant.tsx @@ -6,7 +6,10 @@ import { CreateProductVariantForm } from "./components/create-product-variant-fo export const ProductCreateVariant = () => { const { id } = useParams() - const { product, isLoading, isError, error } = useProduct(id!) + const { product, isLoading, isError, error } = useProduct(id!, { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: "-type,-collection,-tags,-images,-variants,-sales_channels", + }) if (isError) { throw error diff --git a/packages/admin/dashboard/src/routes/products/product-detail/breadcrumb.tsx b/packages/admin/dashboard/src/routes/products/product-detail/breadcrumb.tsx index 1abc880571..67b429dab3 100644 --- a/packages/admin/dashboard/src/routes/products/product-detail/breadcrumb.tsx +++ b/packages/admin/dashboard/src/routes/products/product-detail/breadcrumb.tsx @@ -1,7 +1,6 @@ import { HttpTypes } from "@medusajs/types" import { UIMatch } from "react-router-dom" import { useProduct } from "../../../hooks/api" -import { PRODUCT_DETAIL_FIELDS } from "./constants" type ProductDetailBreadcrumbProps = UIMatch @@ -13,7 +12,9 @@ export const ProductDetailBreadcrumb = ( const { product } = useProduct( id!, { - fields: PRODUCT_DETAIL_FIELDS, + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "-type,-collection,-options,-tags,-images,-variants,-sales_channels", }, { initialData: props.data, diff --git a/packages/admin/dashboard/src/routes/products/product-edit-option/product-edit-option.tsx b/packages/admin/dashboard/src/routes/products/product-edit-option/product-edit-option.tsx index 2b29a3a4aa..a445550816 100644 --- a/packages/admin/dashboard/src/routes/products/product-edit-option/product-edit-option.tsx +++ b/packages/admin/dashboard/src/routes/products/product-edit-option/product-edit-option.tsx @@ -9,7 +9,10 @@ export const ProductEditOption = () => { const { id, option_id } = useParams() const { t } = useTranslation() - const { product, isPending, isFetching, isError, error } = useProduct(id!) + const { product, isPending, isFetching, isError, error } = useProduct(id!, { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: "-type,-collection,-tags,-images,-variants,-sales_channels", + }) const option = product?.options.find((o) => o.id === option_id) diff --git a/packages/admin/dashboard/src/routes/products/product-edit/product-edit.tsx b/packages/admin/dashboard/src/routes/products/product-edit/product-edit.tsx index 0444b715d5..dd729a447c 100644 --- a/packages/admin/dashboard/src/routes/products/product-edit/product-edit.tsx +++ b/packages/admin/dashboard/src/routes/products/product-edit/product-edit.tsx @@ -4,7 +4,6 @@ import { useParams } from "react-router-dom" import { RouteDrawer } from "../../../components/modals" import { useProduct } from "../../../hooks/api/products" -import { PRODUCT_DETAIL_FIELDS } from "../product-detail/constants" import { EditProductForm } from "./components/edit-product-form" export const ProductEdit = () => { @@ -12,7 +11,9 @@ export const ProductEdit = () => { const { t } = useTranslation() const { product, isLoading, isError, error } = useProduct(id!, { - fields: PRODUCT_DETAIL_FIELDS, + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "-type,-collection,-options,-tags,-images,-variants,-sales_channels", }) if (isError) { diff --git a/packages/admin/dashboard/src/routes/products/product-image-variants-edit/product-image-variants-edit.tsx b/packages/admin/dashboard/src/routes/products/product-image-variants-edit/product-image-variants-edit.tsx index 09bc4293f1..e753159d65 100644 --- a/packages/admin/dashboard/src/routes/products/product-image-variants-edit/product-image-variants-edit.tsx +++ b/packages/admin/dashboard/src/routes/products/product-image-variants-edit/product-image-variants-edit.tsx @@ -21,7 +21,11 @@ export const ProductImageVariantsEdit = () => { const { product, isPending } = useProduct( product_id!, - { fields: "images.id,images.url,images.variants.id" }, + { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "images.id,images.url,images.variants.id,-type,-collection,-options,-tags,-variants,-sales_channels", + }, { enabled: !!product_id && !!image_id, } diff --git a/packages/admin/dashboard/src/routes/products/product-media/product-media.tsx b/packages/admin/dashboard/src/routes/products/product-media/product-media.tsx index d5f05866e2..8e061c9626 100644 --- a/packages/admin/dashboard/src/routes/products/product-media/product-media.tsx +++ b/packages/admin/dashboard/src/routes/products/product-media/product-media.tsx @@ -8,7 +8,10 @@ export const ProductMedia = () => { const { t } = useTranslation() const { id } = useParams() - const { product, isLoading, isError, error } = useProduct(id!) + const { product, isLoading, isError, error } = useProduct(id!, { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: "-type,-collection,-options,-tags,-variants,-sales_channels", + }) const ready = !isLoading && product diff --git a/packages/admin/dashboard/src/routes/products/product-metadata/product-metadata.tsx b/packages/admin/dashboard/src/routes/products/product-metadata/product-metadata.tsx index 553b2eb17f..de24fcc207 100644 --- a/packages/admin/dashboard/src/routes/products/product-metadata/product-metadata.tsx +++ b/packages/admin/dashboard/src/routes/products/product-metadata/product-metadata.tsx @@ -5,7 +5,11 @@ import { useProduct, useUpdateProduct } from "../../../hooks/api" export const ProductMetadata = () => { const { id } = useParams() - const { product, isPending, isError, error } = useProduct(id!) + const { product, isPending, isError, error } = useProduct(id!, { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "-type,-collection,-options,-tags,-images,-variants,-sales_channels", + }) const { mutateAsync, isPending: isMutating } = useUpdateProduct(product?.id!) diff --git a/packages/admin/dashboard/src/routes/products/product-organization/product-organization.tsx b/packages/admin/dashboard/src/routes/products/product-organization/product-organization.tsx index a37418d2e3..1db18d20b7 100644 --- a/packages/admin/dashboard/src/routes/products/product-organization/product-organization.tsx +++ b/packages/admin/dashboard/src/routes/products/product-organization/product-organization.tsx @@ -4,7 +4,6 @@ import { useParams } from "react-router-dom" import { RouteDrawer } from "../../../components/modals" import { useProduct } from "../../../hooks/api/products" -import { PRODUCT_DETAIL_FIELDS } from "../product-detail/constants" import { ProductOrganizationForm } from "./components/product-organization-form" export const ProductOrganization = () => { @@ -12,7 +11,8 @@ export const ProductOrganization = () => { const { t } = useTranslation() const { product, isLoading, isError, error } = useProduct(id!, { - fields: PRODUCT_DETAIL_FIELDS, + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: "*categories,-options,-images,-variants,-sales_channels", }) if (isError) { diff --git a/packages/admin/dashboard/src/routes/products/product-prices/product-prices.tsx b/packages/admin/dashboard/src/routes/products/product-prices/product-prices.tsx index 90ea3d888d..5cd987b647 100644 --- a/packages/admin/dashboard/src/routes/products/product-prices/product-prices.tsx +++ b/packages/admin/dashboard/src/routes/products/product-prices/product-prices.tsx @@ -7,7 +7,10 @@ import { PricingEdit } from "./pricing-edit" export const ProductPrices = () => { const { id, variant_id } = useParams() - const { product, isLoading, isError, error } = useProduct(id!) + const { product, isLoading, isError, error } = useProduct(id!, { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: "-type,-collection,-options,-tags,-images,-sales_channels", + }) if (isError) { throw error diff --git a/packages/admin/dashboard/src/routes/products/product-sales-channels/product-sales-channels.tsx b/packages/admin/dashboard/src/routes/products/product-sales-channels/product-sales-channels.tsx index b2aa39ebfc..174ed70a30 100644 --- a/packages/admin/dashboard/src/routes/products/product-sales-channels/product-sales-channels.tsx +++ b/packages/admin/dashboard/src/routes/products/product-sales-channels/product-sales-channels.tsx @@ -6,7 +6,10 @@ import { EditSalesChannelsForm } from "./components/edit-sales-channels-form" export const ProductSalesChannels = () => { const { id } = useParams() - const { product, isLoading, isError, error } = useProduct(id!) + const { product, isLoading, isError, error } = useProduct(id!, { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: "-type,-collection,-options,-tags,-images,-variants", + }) if (isError) { throw error diff --git a/packages/admin/dashboard/src/routes/products/product-shipping-profile/product-shipping-profile.tsx b/packages/admin/dashboard/src/routes/products/product-shipping-profile/product-shipping-profile.tsx index e3d09d5f8c..014fe0aee6 100644 --- a/packages/admin/dashboard/src/routes/products/product-shipping-profile/product-shipping-profile.tsx +++ b/packages/admin/dashboard/src/routes/products/product-shipping-profile/product-shipping-profile.tsx @@ -4,7 +4,6 @@ import { useParams } from "react-router-dom" import { RouteDrawer } from "../../../components/modals" import { useProduct } from "../../../hooks/api/products" -import { PRODUCT_DETAIL_FIELDS } from "../product-detail/constants" import { ProductShippingProfileForm } from "./components/product-organization-form" export const ProductShippingProfile = () => { @@ -12,7 +11,9 @@ export const ProductShippingProfile = () => { const { t } = useTranslation() const { product, isLoading, isError, error } = useProduct(id!, { - fields: PRODUCT_DETAIL_FIELDS, + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "*shipping_profile,-type,-collection,-options,-tags,-images,-variants,-sales_channels", }) if (isError) { diff --git a/packages/admin/dashboard/src/routes/tax-regions/common/components/target-item/target-item.tsx b/packages/admin/dashboard/src/routes/tax-regions/common/components/target-item/target-item.tsx index 4f200288cd..3da57d2fb9 100644 --- a/packages/admin/dashboard/src/routes/tax-regions/common/components/target-item/target-item.tsx +++ b/packages/admin/dashboard/src/routes/tax-regions/common/components/target-item/target-item.tsx @@ -17,7 +17,11 @@ export const TargetItem = ({ }: TargetItemProps) => { const { product } = useProduct( value, - { fields: "id,title" }, + { + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "id,title,-type,-collection,-options,-tags,-images,-variants,-sales_channels", + }, { enabled: !label } ) diff --git a/packages/admin/dashboard/src/routes/tax-regions/common/components/tax-override-card/tax-override-card.tsx b/packages/admin/dashboard/src/routes/tax-regions/common/components/tax-override-card/tax-override-card.tsx index adf3474be7..9737b2c74c 100644 --- a/packages/admin/dashboard/src/routes/tax-regions/common/components/tax-override-card/tax-override-card.tsx +++ b/packages/admin/dashboard/src/routes/tax-regions/common/components/tax-override-card/tax-override-card.tsx @@ -39,18 +39,15 @@ export const TaxOverrideCard = ({ taxRate }: TaxOverrideCardProps) => { return null } - const groupedRules = taxRate.rules.reduce( - (acc, rule) => { - if (!acc[rule.reference]) { - acc[rule.reference] = [] - } + const groupedRules = taxRate.rules.reduce((acc, rule) => { + if (!acc[rule.reference]) { + acc[rule.reference] = [] + } - acc[rule.reference].push(rule.reference_id) + acc[rule.reference].push(rule.reference_id) - return acc - }, - {} as Record - ) + return acc + }, {} as Record) const validKeys = Object.values(TaxRateRuleReferenceType) const numberOfTargets = Object.keys(groupedRules).map((key) => @@ -282,6 +279,9 @@ const useReferenceValues = ( { id: ids.slice(0, DISPLAY_OVERRIDE_ITEMS_LIMIT), limit: DISPLAY_OVERRIDE_ITEMS_LIMIT, + // TODO: Remove exclusion once we avoid including unnecessary relations by default in the query config + fields: + "-type,-collection,-options,-tags,-images,-variants,-sales_channels", }, { enabled: !!ids.length && type === TaxRateRuleReferenceType.PRODUCT,