Skip to content

Commit

Permalink
change function names
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogge committed Mar 20, 2024
1 parent 2034045 commit 59d8a4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions presenter/renderer/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createSSRApp, defineComponent, h, markRaw, reactive, Component, provide

import PageShell from '#components/PageShell.vue'
import { setPageContext } from '#context/usePageContext'
import { getApolloClient } from '#plugins/apollo'
import { createApolloClient } from '#plugins/apollo'
import i18n from '#plugins/i18n'
import pinia from '#plugins/pinia'
import CreateVuetify from '#plugins/vuetify'
Expand All @@ -19,7 +19,7 @@ function createApp(pageContext: PageContext, isClient = true) {
let rootComponent: InstanceType<typeof PageWithWrapper>
const PageWithWrapper = defineComponent({
setup: () => {
provide(DefaultApolloClient, getApolloClient(getToken))
provide(DefaultApolloClient, createApolloClient(getToken))
provide('authService', new AuthService())
},
data: () => ({
Expand Down
6 changes: 3 additions & 3 deletions presenter/renderer/plugins/apollo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createHttpLink } from '@apollo/client/link/http'

import { ENDPOINTS } from '#src/env'

const getAuthLink = (getToken: () => string) => {
const createAuthLink = (getToken: () => string) => {
return setContext((_, { headers }) => {
const token = getToken()
return {
Expand Down Expand Up @@ -37,10 +37,10 @@ const errorLink = onError(({ graphQLErrors, networkError }) => {

const cache = new InMemoryCache()

export const getApolloClient = (getToken: () => string) => {
export const createApolloClient = (getToken: () => string) => {
return new ApolloClient({
ssrMode: true,
link: getAuthLink(getToken).concat(httpLink), // errorLink.concat(httpLink),
link: createAuthLink(getToken).concat(httpLink), // errorLink.concat(httpLink),
cache,
})
}

0 comments on commit 59d8a4c

Please sign in to comment.