12345678910111213141516171819202122 |
- // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
- import type { App } from 'vue'
- import {
- DefaultApolloClient,
- provideApolloClient,
- } from '@vue/apollo-composable'
- import type { CacheInitializerModules } from '#shared/types/server/apollo/client.ts'
- import { createApolloClient } from './client.ts'
- const initializeApolloClient = (
- app: App,
- cacheInitializerModules: CacheInitializerModules = {},
- ) => {
- const apolloClient = createApolloClient(cacheInitializerModules)
- app.provide(DefaultApolloClient, apolloClient)
- provideApolloClient(apolloClient)
- }
- export default initializeApolloClient
|