fix(fe): preload navigationWorkspaceSwitcherQuery

This commit is contained in:
andrewwallacespeckle
2025-08-18 15:29:34 +01:00
parent 9e808b48cc
commit bb18ee79b4
+12 -1
View File
@@ -5,6 +5,7 @@ import {
} from '~/lib/auth/graphql/queries'
import { usePreloadApolloQueries } from '~/lib/common/composables/graphql'
import { mainServerInfoDataQuery } from '~/lib/core/composables/server'
import { navigationWorkspaceSwitcherQuery } from '~/lib/navigation/graphql/queries'
/**
* Prefetches data for specific routes to avoid the problem of serial API requests
@@ -26,7 +27,17 @@ export default defineNuxtPlugin(async (ctx) => {
// Standard/global
promises.push(
preload({
queries: [{ query: activeUserQuery }, { query: mainServerInfoDataQuery }]
queries: [
{ query: activeUserQuery },
{ query: mainServerInfoDataQuery },
...(isWorkspacesEnabled.value
? [
{
query: navigationWorkspaceSwitcherQuery
}
]
: [])
]
})
)