diff --git a/src/hooks/useDatabaseAccounts.tsx b/src/hooks/useDatabaseAccounts.tsx index 9a28afaad..f517b2e30 100644 --- a/src/hooks/useDatabaseAccounts.tsx +++ b/src/hooks/useDatabaseAccounts.tsx @@ -52,11 +52,17 @@ export async function fetchDatabaseAccountsFromGraph( const body = { query: databaseAccountsQuery, subscriptions: [subscriptionId], - ...(skipToken && { - options: { - $skipToken: skipToken, - } as QueryRequestOptions, - }), + ...(skipToken + ? { + options: { + $skipToken: skipToken, + } as QueryRequestOptions, + } + : { + options: { + $top: 150, + } as QueryRequestOptions, + }), }; const response = await fetch(managementResourceGraphAPIURL, { diff --git a/src/hooks/useSubscriptions.tsx b/src/hooks/useSubscriptions.tsx index 5fa7073be..a8e4addf5 100644 --- a/src/hooks/useSubscriptions.tsx +++ b/src/hooks/useSubscriptions.tsx @@ -51,11 +51,17 @@ export async function fetchSubscriptionsFromGraph(accessToken: string): Promise< do { const body = { query: subscriptionsQuery, - ...(skipToken && { - options: { - $skipToken: skipToken, - } as QueryRequestOptions, - }), + ...(skipToken + ? { + options: { + $skipToken: skipToken, + } as QueryRequestOptions, + } + : { + options: { + $top: 150, + } as QueryRequestOptions, + }), }; const response = await fetch(managementResourceGraphAPIURL, {