Skip to content

Commit 86c89de

Browse files
committed
feat!: Update to Apollo 4.0
1 parent 1f8c7a3 commit 86c89de

File tree

4 files changed

+34
-97
lines changed

4 files changed

+34
-97
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"release": "standard-version --prerelease alpha && git push --follow-tags && pnpm publish --tag next"
4040
},
4141
"dependencies": {
42-
"@apollo/client": "^3.14.0",
42+
"@apollo/client": "^4.0.0",
4343
"@nuxt/kit": "^4.2.2",
4444
"@rollup/plugin-graphql": "^2.0.5",
4545
"@vue/apollo-composable": "^4.2.2",
@@ -51,7 +51,8 @@
5151
"graphql-tag": "^2.12.6",
5252
"graphql-ws": "^6.0.6",
5353
"jiti": "^2.6.1",
54-
"ohash": "^2.0.11"
54+
"ohash": "^2.0.11",
55+
"rxjs": "^7.8.2"
5556
},
5657
"devDependencies": {
5758
"@eslint/compat": "^2.0.0",

pnpm-lock.yaml

Lines changed: 26 additions & 90 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/runtime/composables.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ export function useApollo(): {
189189
/**
190190
* Access the configured apollo clients.
191191
*/
192-
clients: Record<ApolloClientKeys, ApolloClient<unknown>> | undefined
192+
clients: Record<ApolloClientKeys, ApolloClient> | undefined
193193
/**
194194
* Retrieve the auth token for the specified client. Adheres to the `apollo:auth` hook.
195195
*
@@ -217,7 +217,7 @@ export function useApollo(): {
217217

218218
export function useApollo() {
219219
const nuxtApp = useNuxtApp() as NuxtApp & {
220-
_apolloClients?: Record<ApolloClientKeys, ApolloClient<unknown>>
220+
_apolloClients?: Record<ApolloClientKeys, ApolloClient>
221221
_apolloWsClients?: Record<ApolloClientKeys, RestartableClient>
222222
}
223223

src/runtime/plugin.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type { ApolloClientKeys } from '#apollo'
1919
export default defineNuxtPlugin((nuxtApp) => {
2020
const requestCookies = (import.meta.server && useRequestHeaders(['cookie'])) || undefined
2121

22-
const clients = {} as Record<ApolloClientKeys, ApolloClient<unknown>>
22+
const clients = {} as Record<ApolloClientKeys, ApolloClient>
2323

2424
for (const [key, clientConfig] of Object.entries(NuxtApollo.clients) as [ApolloClientKeys, ClientConfig][]) {
2525
const getAuth = async () => {
@@ -179,8 +179,8 @@ export interface ModuleRuntimeHooks {
179179
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
180180
interface DollarApolloHelpers extends ReturnType<typeof useApollo> {}
181181
interface DollarApollo {
182-
clients: Record<ApolloClientKeys, ApolloClient<unknown>>
183-
defaultClient: ApolloClient<unknown>
182+
clients: Record<ApolloClientKeys, ApolloClient>
183+
defaultClient: ApolloClient
184184
}
185185

186186
declare module '#app' {

0 commit comments

Comments
 (0)