From 0eda4a7e5608909ec62b7c3e5a447d970fe6a263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rge=20N=C3=A6ss?= Date: Mon, 5 Feb 2024 18:13:58 +0100 Subject: [PATCH] fix(migrate): submit mutations with visibility=async (#5675) --- packages/@sanity/migrate/src/fetch-utils/endpoints.ts | 4 ++-- packages/@sanity/migrate/src/runner/run.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@sanity/migrate/src/fetch-utils/endpoints.ts b/packages/@sanity/migrate/src/fetch-utils/endpoints.ts index 03a1e13fa3b..9dcb46becf3 100644 --- a/packages/@sanity/migrate/src/fetch-utils/endpoints.ts +++ b/packages/@sanity/migrate/src/fetch-utils/endpoints.ts @@ -34,7 +34,7 @@ export const endpoints = { options?: { returnIds?: boolean returnDocuments?: boolean - visiblity?: 'async' | 'sync' | 'deferred' + visibility?: 'async' | 'sync' | 'deferred' dryRun?: boolean tag?: string }, @@ -43,7 +43,7 @@ export const endpoints = { options?.tag && ['tag', options.tag], options?.returnIds && ['returnIds', 'true'], options?.returnDocuments && ['returnDocuments', 'true'], - options?.visiblity && ['visibility', options.visiblity], + options?.visibility && ['visibility', options.visibility], options?.dryRun && ['dryRun', 'true'], ].filter(Boolean) as [string, string][] diff --git a/packages/@sanity/migrate/src/runner/run.ts b/packages/@sanity/migrate/src/runner/run.ts index 3fb6df6aba0..3f57706827d 100644 --- a/packages/@sanity/migrate/src/runner/run.ts +++ b/packages/@sanity/migrate/src/runner/run.ts @@ -45,7 +45,7 @@ export async function* toFetchOptionsIterable( token: apiConfig.token, tag: 'sanity.migration.mutate', apiHost: apiConfig.apiHost ?? 'api.sanity.io', - endpoint: endpoints.data.mutate(apiConfig.dataset, {returnIds: true}), + endpoint: endpoints.data.mutate(apiConfig.dataset, {returnIds: true, visibility: 'async'}), body: JSON.stringify(transaction), }) }