diff --git a/packages/vue-apollo-composable/src/useQuery.ts b/packages/vue-apollo-composable/src/useQuery.ts index 32f6b9d7..ad6ef4f1 100644 --- a/packages/vue-apollo-composable/src/useQuery.ts +++ b/packages/vue-apollo-composable/src/useQuery.ts @@ -172,7 +172,7 @@ export function useQueryImpl< // SSR let firstResolve: (() => void) | undefined let firstReject: ((apolloError: ApolloError) => void) | undefined - onServerPrefetch?.(() => { + vm && onServerPrefetch?.(() => { if (!isEnabled.value || (isServer && currentOptions.value?.prefetch === false)) return return new Promise((resolve, reject) => {