From ddaeafacddf0c080e8901e06cbab9f1d0971d42c Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 4 Feb 2025 12:15:14 +0200 Subject: [PATCH] docs: fix metadata destructure in query.graph (#11294) --- .../learn/customization/customize-admin/route/page.mdx | 2 +- .../app/learn/fundamentals/module-links/query/page.mdx | 2 +- www/apps/book/generated/edit-dates.mjs | 4 ++-- www/apps/resources/app/examples/page.mdx | 2 +- .../resources/app/integrations/guides/sanity/page.mdx | 2 +- .../recipes/digital-products/examples/standard/page.mdx | 2 +- .../app/recipes/subscriptions/examples/standard/page.mdx | 2 +- www/apps/resources/generated/edit-dates.mjs | 8 ++++---- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/www/apps/book/app/learn/customization/customize-admin/route/page.mdx b/www/apps/book/app/learn/customization/customize-admin/route/page.mdx index 2e900054e4..349bdd45df 100644 --- a/www/apps/book/app/learn/customization/customize-admin/route/page.mdx +++ b/www/apps/book/app/learn/customization/customize-admin/route/page.mdx @@ -43,7 +43,7 @@ export const GET = async ( const { data: brands, - metadata: { count, take, skip }, + metadata: { count, take, skip } = {}, } = await query.graph({ entity: "brand", ...req.queryConfig, diff --git a/www/apps/book/app/learn/fundamentals/module-links/query/page.mdx b/www/apps/book/app/learn/fundamentals/module-links/query/page.mdx index fbfb081678..fc4075c623 100644 --- a/www/apps/book/app/learn/fundamentals/module-links/query/page.mdx +++ b/www/apps/book/app/learn/fundamentals/module-links/query/page.mdx @@ -217,7 +217,7 @@ Filters don't apply on fields of linked data models from other modules. ```ts highlights={[["8", "skip", "The number of records to skip before fetching the results."], ["9", "take", "The number of records to fetch."]]} const { data: myCustoms, - metadata: { count, take, skip }, + metadata: { count, take, skip } = {}, } = await query.graph({ entity: "my_custom", fields: ["id", "name"], diff --git a/www/apps/book/generated/edit-dates.mjs b/www/apps/book/generated/edit-dates.mjs index 8b56744cd1..4c44747767 100644 --- a/www/apps/book/generated/edit-dates.mjs +++ b/www/apps/book/generated/edit-dates.mjs @@ -75,7 +75,7 @@ export const generatedEditDates = { "app/learn/fundamentals/module-links/custom-columns/page.mdx": "2025-01-06T11:19:13.178Z", "app/learn/fundamentals/module-links/directions/page.mdx": "2024-12-12T15:31:31.555Z", "app/learn/fundamentals/module-links/page.mdx": "2024-12-09T14:39:26.668Z", - "app/learn/fundamentals/module-links/query/page.mdx": "2024-12-09T15:54:44.798Z", + "app/learn/fundamentals/module-links/query/page.mdx": "2025-02-04T07:35:31.633Z", "app/learn/fundamentals/modules/db-operations/page.mdx": "2024-12-09T14:40:50.581Z", "app/learn/fundamentals/modules/multiple-services/page.mdx": "2024-10-21T13:30:21.370Z", "app/learn/fundamentals/modules/page.mdx": "2025-01-16T08:34:28.947Z", @@ -88,7 +88,7 @@ export const generatedEditDates = { "app/learn/customization/extend-features/extend-create-product/page.mdx": "2025-01-06T11:18:58.250Z", "app/learn/customization/custom-features/page.mdx": "2024-12-09T10:46:28.593Z", "app/learn/customization/customize-admin/page.mdx": "2024-12-09T11:02:38.801Z", - "app/learn/customization/customize-admin/route/page.mdx": "2025-01-27T08:45:19.021Z", + "app/learn/customization/customize-admin/route/page.mdx": "2025-02-04T07:35:04.523Z", "app/learn/customization/customize-admin/widget/page.mdx": "2025-01-27T08:45:19.022Z", "app/learn/customization/extend-features/define-link/page.mdx": "2024-12-09T11:02:39.346Z", "app/learn/customization/extend-features/page.mdx": "2024-12-09T11:02:39.244Z", diff --git a/www/apps/resources/app/examples/page.mdx b/www/apps/resources/app/examples/page.mdx index a1eca5ade1..36064f3032 100644 --- a/www/apps/resources/app/examples/page.mdx +++ b/www/apps/resources/app/examples/page.mdx @@ -2028,7 +2028,7 @@ export const GET = async ( const { data: myCustoms, - metadata: { count, take, skip }, + metadata: { count, take, skip } = {}, } = await query.graph({ entity: "my_custom", fields: ["id", "name"], diff --git a/www/apps/resources/app/integrations/guides/sanity/page.mdx b/www/apps/resources/app/integrations/guides/sanity/page.mdx index 352ce131d6..f5aac1a0ce 100644 --- a/www/apps/resources/app/integrations/guides/sanity/page.mdx +++ b/www/apps/resources/app/integrations/guides/sanity/page.mdx @@ -711,7 +711,7 @@ export const syncStep = createStep( while (hasMore) { const { data: products, - metadata: { count }, + metadata: { count } = {}, } = await query.graph({ entity: "product", fields: [ diff --git a/www/apps/resources/app/recipes/digital-products/examples/standard/page.mdx b/www/apps/resources/app/recipes/digital-products/examples/standard/page.mdx index 99c5b5d492..3d444c58d3 100644 --- a/www/apps/resources/app/recipes/digital-products/examples/standard/page.mdx +++ b/www/apps/resources/app/recipes/digital-products/examples/standard/page.mdx @@ -361,7 +361,7 @@ export const GET = async ( const { data: digitalProducts, - metadata: { count, take, skip }, + metadata: { count, take, skip } = {}, } = await query.graph({ entity: "digital_product", fields: [ diff --git a/www/apps/resources/app/recipes/subscriptions/examples/standard/page.mdx b/www/apps/resources/app/recipes/subscriptions/examples/standard/page.mdx index 63dbae46c4..5bdaaf7fbe 100644 --- a/www/apps/resources/app/recipes/subscriptions/examples/standard/page.mdx +++ b/www/apps/resources/app/recipes/subscriptions/examples/standard/page.mdx @@ -1063,7 +1063,7 @@ export const GET = async ( const { data: subscriptions, - metadata: { count, take, skip }, + metadata: { count, take, skip } = {}, } = await query.graph({ entity: "subscription", fields: [ diff --git a/www/apps/resources/generated/edit-dates.mjs b/www/apps/resources/generated/edit-dates.mjs index 044c74ff5a..2657c28b6b 100644 --- a/www/apps/resources/generated/edit-dates.mjs +++ b/www/apps/resources/generated/edit-dates.mjs @@ -112,7 +112,7 @@ export const generatedEditDates = { "app/nextjs-starter/page.mdx": "2025-01-06T12:19:31.143Z", "app/recipes/b2b/page.mdx": "2025-01-29T11:35:23.247Z", "app/recipes/commerce-automation/page.mdx": "2024-10-16T08:52:01.585Z", - "app/recipes/digital-products/examples/standard/page.mdx": "2025-01-13T11:31:35.362Z", + "app/recipes/digital-products/examples/standard/page.mdx": "2025-02-04T07:36:59.024Z", "app/recipes/digital-products/page.mdx": "2025-01-06T11:19:35.623Z", "app/recipes/ecommerce/page.mdx": "2024-10-22T11:01:01.218Z", "app/recipes/integrate-ecommerce-stack/page.mdx": "2024-12-09T13:03:35.846Z", @@ -123,7 +123,7 @@ export const generatedEditDates = { "app/recipes/oms/page.mdx": "2024-07-01T10:21:19+03:00", "app/recipes/personalized-products/page.mdx": "2024-10-03T13:07:44.153Z", "app/recipes/pos/page.mdx": "2024-10-03T13:07:13.964Z", - "app/recipes/subscriptions/examples/standard/page.mdx": "2025-01-06T11:19:35.640Z", + "app/recipes/subscriptions/examples/standard/page.mdx": "2025-02-04T07:37:14.832Z", "app/recipes/subscriptions/page.mdx": "2024-10-03T13:07:44.155Z", "app/recipes/page.mdx": "2024-07-11T15:56:41+00:00", "app/service-factory-reference/methods/create/page.mdx": "2024-07-31T17:01:33+03:00", @@ -2176,7 +2176,7 @@ export const generatedEditDates = { "app/commerce-modules/sales-channel/links-to-other-modules/page.mdx": "2025-01-06T11:19:35.620Z", "app/commerce-modules/stock-location/links-to-other-modules/page.mdx": "2025-01-06T11:19:35.619Z", "app/commerce-modules/store/links-to-other-modules/page.mdx": "2024-12-24T14:58:24.038Z", - "app/examples/page.mdx": "2025-01-06T11:19:35.623Z", + "app/examples/page.mdx": "2025-02-04T07:36:39.956Z", "app/medusa-cli/commands/build/page.mdx": "2024-11-11T11:00:49.665Z", "app/js-sdk/page.mdx": "2024-12-12T11:41:51.152Z", "references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.apiKey/page.mdx": "2025-01-13T18:05:58.463Z", @@ -3147,7 +3147,7 @@ export const generatedEditDates = { "references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantRequest/page.mdx": "2024-12-09T13:21:34.309Z", "references/types/WorkflowTypes/ProductWorkflow/interfaces/types.WorkflowTypes.ProductWorkflow.ExportProductsDTO/page.mdx": "2025-01-13T18:05:55.538Z", "app/contribution-guidelines/admin-translations/page.mdx": "2024-11-14T08:54:15.369Z", - "app/integrations/guides/sanity/page.mdx": "2025-01-06T13:52:48.705Z", + "app/integrations/guides/sanity/page.mdx": "2025-02-04T07:36:48.007Z", "references/api_key/types/api_key.FindConfigOrder/page.mdx": "2024-11-25T17:49:28.715Z", "references/auth/types/auth.FindConfigOrder/page.mdx": "2024-11-25T17:49:28.887Z", "references/cart/types/cart.FindConfigOrder/page.mdx": "2024-11-25T17:49:29.455Z",