From c412a31985f3c622e5e3cf366699f9e6977184a2 Mon Sep 17 00:00:00 2001 From: mtlemilio Date: Tue, 4 Feb 2025 13:47:53 -0600 Subject: [PATCH] Use fetchPagedListResult when listing Hyperdrive configs from API (#8012) --- .changeset/smooth-games-cover.md | 7 +++++++ packages/wrangler/src/hyperdrive/client.ts | 11 +++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 .changeset/smooth-games-cover.md diff --git a/.changeset/smooth-games-cover.md b/.changeset/smooth-games-cover.md new file mode 100644 index 000000000000..d6baae67889a --- /dev/null +++ b/.changeset/smooth-games-cover.md @@ -0,0 +1,7 @@ +--- +"wrangler": patch +--- + +Use fetchPagedListResult when listing Hyperdrive configs from the API + +This fixes an issue where only 20 configs were being listed. diff --git a/packages/wrangler/src/hyperdrive/client.ts b/packages/wrangler/src/hyperdrive/client.ts index 82734a1ccb83..5073c14d0597 100644 --- a/packages/wrangler/src/hyperdrive/client.ts +++ b/packages/wrangler/src/hyperdrive/client.ts @@ -1,4 +1,4 @@ -import { fetchResult } from "../cfetch"; +import { fetchPagedListResult, fetchResult } from "../cfetch"; import { requireAuth } from "../user"; import type { Config } from "../config"; @@ -111,9 +111,12 @@ export async function getConfig( export async function listConfigs(config: Config): Promise { const accountId = await requireAuth(config); - return await fetchResult(`/accounts/${accountId}/hyperdrive/configs`, { - method: "GET", - }); + return await fetchPagedListResult( + `/accounts/${accountId}/hyperdrive/configs`, + { + method: "GET", + } + ); } export async function patchConfig(