import type { TypedDocumentNode } from '@graphql-typed-document-node/core' /** * SSR-friendly обёртка над useGraphQL.execute. * Выполняет запрос на сервере (и на клиенте при навигации), возвращает useAsyncData-результат. */ export const useServerQuery = async >( key: string, document: TypedDocumentNode, variables: TVariables, endpoint: 'user' | 'team' | 'public', api: 'teams' | 'exchange' | 'kyc' | 'orders' | 'geo' | 'billing' ) => { const { execute } = useGraphQL() return useAsyncData(key, () => execute(document, variables, endpoint, api), { server: true, lazy: false, immediate: true }) }