diff --git a/package.json b/package.json index 9e6d32354..5636142fa 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "@angular/platform-browser-dynamic": "^18.0.0", "@angular/platform-server": "^18.0.0", "@angular/router": "^18.0.0", - "@apollo/client": "^3.13.1", + "@apollo/client": "https://pkg.pr.new/@apollo/client@12221", "@babel/core": "^7.24.6", "@babel/preset-env": "^7.24.6", "@changesets/changelog-github": "^0.5.0", diff --git a/packages/apollo-angular/headers/tests/index.spec.ts b/packages/apollo-angular/headers/tests/index.spec.ts index 759f93591..30f0eaee1 100644 --- a/packages/apollo-angular/headers/tests/index.spec.ts +++ b/packages/apollo-angular/headers/tests/index.spec.ts @@ -1,6 +1,7 @@ +import { of } from 'rxjs'; import { describe, expect, test } from 'vitest'; import { HttpHeaders } from '@angular/common/http'; -import { ApolloLink, execute, gql, Observable as LinkObservable } from '@apollo/client/core'; +import { ApolloLink, execute, gql } from '@apollo/client/core'; import { httpHeaders } from '../src'; const query = gql` @@ -24,7 +25,7 @@ describe('httpHeaders', () => { expect(headers instanceof HttpHeaders).toBe(true); expect(headers.get('Authorization')).toBe('Bearer Foo'); - return LinkObservable.of({ data }); + return of({ data }); }); const link = headersLink.concat(mockLink); @@ -51,7 +52,7 @@ describe('httpHeaders', () => { expect(headers).toBeUndefined(); - return LinkObservable.of({ data }); + return of({ data }); }); const link = headersLink.concat(mockLink); diff --git a/packages/apollo-angular/http/src/http-batch-link.ts b/packages/apollo-angular/http/src/http-batch-link.ts index 93a70e434..6663f698a 100644 --- a/packages/apollo-angular/http/src/http-batch-link.ts +++ b/packages/apollo-angular/http/src/http-batch-link.ts @@ -1,12 +1,8 @@ import { print } from 'graphql'; +import { Observable } from 'rxjs'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { - ApolloLink, - FetchResult, - Observable as LinkObservable, - Operation, -} from '@apollo/client/core'; +import { ApolloLink, FetchResult, Operation } from '@apollo/client/core'; import { BatchHandler, BatchLink } from '@apollo/client/link/batch'; import { BatchOptions, Body, Context, OperationPrinter, Options, Request } from './types'; import { createHeadersWithClientAwareness, fetch, mergeHeaders, prioritize } from './utils'; @@ -53,7 +49,7 @@ export class HttpBatchLinkHandler extends ApolloLink { } const batchHandler: BatchHandler = (operations: Operation[]) => { - return new LinkObservable((observer: any) => { + return new Observable((observer: any) => { const body = this.createBody(operations); const headers = this.createHeaders(operations); const { method, uri, withCredentials } = this.createOptions(operations); @@ -175,7 +171,7 @@ export class HttpBatchLinkHandler extends ApolloLink { return prioritize(context.uri, this.options.uri, '') + opts; } - public request(op: Operation): LinkObservable | null { + public request(op: Operation): Observable | null { return this.batcher.request(op); } } diff --git a/packages/apollo-angular/http/src/http-link.ts b/packages/apollo-angular/http/src/http-link.ts index 7d40d281f..9fe1de4e9 100644 --- a/packages/apollo-angular/http/src/http-link.ts +++ b/packages/apollo-angular/http/src/http-link.ts @@ -1,19 +1,15 @@ import { print } from 'graphql'; +import { Observable } from 'rxjs'; import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import { - ApolloLink, - FetchResult, - Observable as LinkObservable, - Operation, -} from '@apollo/client/core'; +import { ApolloLink, FetchResult, Operation } from '@apollo/client/core'; import { pick } from './http-batch-link'; import { Body, Context, OperationPrinter, Options, Request } from './types'; import { createHeadersWithClientAwareness, fetch, mergeHeaders } from './utils'; // XXX find a better name for it export class HttpLinkHandler extends ApolloLink { - public requester: (operation: Operation) => LinkObservable | null; + public requester: (operation: Operation) => Observable | null; private print: OperationPrinter = print; constructor( @@ -27,7 +23,7 @@ export class HttpLinkHandler extends ApolloLink { } this.requester = (operation: Operation) => - new LinkObservable((observer: any) => { + new Observable((observer: any) => { const context: Context = operation.getContext(); let method = pick(context, this.options, 'method'); @@ -89,7 +85,7 @@ export class HttpLinkHandler extends ApolloLink { }); } - public request(op: Operation): LinkObservable | null { + public request(op: Operation): Observable | null { return this.requester(op); } } diff --git a/packages/apollo-angular/http/tests/http-link.spec.ts b/packages/apollo-angular/http/tests/http-link.spec.ts index c0d84ac3c..387e7326d 100644 --- a/packages/apollo-angular/http/tests/http-link.spec.ts +++ b/packages/apollo-angular/http/tests/http-link.spec.ts @@ -1,5 +1,5 @@ import { print, stripIgnoredCharacters } from 'graphql'; -import { mergeMap } from 'rxjs/operators'; +import { map, mergeMap } from 'rxjs/operators'; import { afterEach, beforeEach, describe, expect, test } from 'vitest'; import { HttpHeaders, provideHttpClient } from '@angular/common/http'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; @@ -512,14 +512,16 @@ describe('HttpLink', () => { test('should set response in context', () => new Promise(done => { const afterware = new ApolloLink((op, forward) => { - return forward(op).map(response => { - const context = op.getContext(); + return forward(op).pipe( + map(response => { + const context = op.getContext(); - expect(context.response).toBeDefined(); - done(); + expect(context.response).toBeDefined(); + done(); - return response; - }); + return response; + }), + ); }); const link = afterware.concat( httpLink.create({ diff --git a/packages/apollo-angular/persisted-queries/tests/persisted-queries.spec.ts b/packages/apollo-angular/persisted-queries/tests/persisted-queries.spec.ts index 16f662f44..7e06a7761 100644 --- a/packages/apollo-angular/persisted-queries/tests/persisted-queries.spec.ts +++ b/packages/apollo-angular/persisted-queries/tests/persisted-queries.spec.ts @@ -1,5 +1,6 @@ +import { Observable } from 'rxjs'; import { describe, expect, test, vi } from 'vitest'; -import { ApolloLink, execute, FetchResult, gql, Observable, Operation } from '@apollo/client/core'; +import { ApolloLink, execute, FetchResult, gql, Operation } from '@apollo/client/core'; import { createPersistedQueryLink } from '../src'; const query = gql` diff --git a/packages/apollo-angular/src/apollo.ts b/packages/apollo-angular/src/apollo.ts index 63b23bcac..a439332f9 100644 --- a/packages/apollo-angular/src/apollo.ts +++ b/packages/apollo-angular/src/apollo.ts @@ -1,4 +1,4 @@ -import { from, Observable } from 'rxjs'; +import { Observable } from 'rxjs'; import { Inject, Injectable, NgZone, Optional } from '@angular/core'; import type { ApolloClientOptions, @@ -23,10 +23,9 @@ import type { WatchFragmentOptions, WatchQueryOptions, } from './types'; -import { fixObservable, fromPromise, useMutationLoading, wrapWithZone } from './utils'; +import { fromLazyPromise, useMutationLoading, wrapWithZone } from './utils'; export class ApolloBase { - private useInitialLoading: boolean; private useMutationLoading: boolean; constructor( @@ -34,7 +33,6 @@ export class ApolloBase { protected readonly flags?: Flags, protected _client?: ApolloClient, ) { - this.useInitialLoading = flags?.useInitialLoading ?? false; this.useMutationLoading = flags?.useMutationLoading ?? false; } @@ -46,24 +44,22 @@ export class ApolloBase { ...options, }) as ObservableQuery, this.ngZone, - { - useInitialLoading: this.useInitialLoading, - ...options, - }, ); } public query( options: QueryOptions, ): Observable> { - return fromPromise>(() => this.ensureClient().query({ ...options })); + return fromLazyPromise>(() => + this.ensureClient().query({ ...options }), + ); } public mutate( options: MutationOptions, ): Observable> { return useMutationLoading( - fromPromise(() => this.ensureClient().mutate({ ...options })), + fromLazyPromise(() => this.ensureClient().mutate({ ...options })), options.useMutationLoading ?? this.useMutationLoading, ); } @@ -75,9 +71,7 @@ export class ApolloBase { options: WatchFragmentOptions, extra?: ExtraSubscriptionOptions, ): Observable> { - const obs = from( - fixObservable(this.ensureClient().watchFragment({ ...options })), - ); + const obs = this.ensureClient().watchFragment({ ...options }); return extra && extra.useZone !== true ? obs : wrapWithZone(obs, this.ngZone); } @@ -86,7 +80,7 @@ export class ApolloBase { options: SubscriptionOptions, extra?: ExtraSubscriptionOptions, ): Observable> { - const obs = from(fixObservable(this.ensureClient().subscribe({ ...options }))); + const obs = this.ensureClient().subscribe({ ...options }); return extra && extra.useZone !== true ? obs : wrapWithZone(obs, this.ngZone); } diff --git a/packages/apollo-angular/src/query-ref.ts b/packages/apollo-angular/src/query-ref.ts index 4d4fb52b5..67504666f 100644 --- a/packages/apollo-angular/src/query-ref.ts +++ b/packages/apollo-angular/src/query-ref.ts @@ -1,4 +1,4 @@ -import { from, Observable } from 'rxjs'; +import { Observable } from 'rxjs'; import { NgZone } from '@angular/core'; import type { ApolloQueryResult, @@ -10,38 +10,8 @@ import type { TypedDocumentNode, Unmasked, } from '@apollo/client/core'; -import { NetworkStatus } from '@apollo/client/core'; -import { EmptyObject, WatchQueryOptions } from './types'; -import { fixObservable, wrapWithZone } from './utils'; - -function useInitialLoading(obsQuery: ObservableQuery) { - return function useInitialLoadingOperator(source: Observable): Observable { - return new Observable(function useInitialLoadingSubscription(subscriber) { - const currentResult = obsQuery.getCurrentResult(); - const { loading, errors, error, partial, data } = currentResult; - const { partialRefetch, fetchPolicy } = obsQuery.options; - - const hasError = errors || error; - - if ( - partialRefetch && - partial && - (!data || Object.keys(data).length === 0) && - fetchPolicy !== 'cache-only' && - !loading && - !hasError - ) { - subscriber.next({ - ...currentResult, - loading: true, - networkStatus: NetworkStatus.loading, - } as any); - } - - return source.subscribe(subscriber); - }); - }; -} +import { EmptyObject } from './types'; +import { fromObservableQuery, wrapWithZone } from './utils'; export type QueryRefFromDocument = T extends TypedDocumentNode ? QueryRef : never; @@ -53,13 +23,8 @@ export class QueryRef, ngZone: NgZone, - options: WatchQueryOptions, ) { - const wrapped = wrapWithZone(from(fixObservable(this.obsQuery)), ngZone); - - this.valueChanges = options.useInitialLoading - ? wrapped.pipe(useInitialLoading(this.obsQuery)) - : wrapped; + this.valueChanges = wrapWithZone(fromObservableQuery(this.obsQuery), ngZone); this.queryId = this.obsQuery.queryId; } diff --git a/packages/apollo-angular/src/types.ts b/packages/apollo-angular/src/types.ts index 1259f49a2..972d4605f 100644 --- a/packages/apollo-angular/src/types.ts +++ b/packages/apollo-angular/src/types.ts @@ -44,15 +44,7 @@ export interface SubscriptionOptionsAlone extends Omit, 'query' | 'variables'> {} export interface WatchQueryOptions - extends CoreWatchQueryOptions { - /** - * Observable starts with `{ loading: true }`. - * There's a big chance the next major version will enable that by default. - * - * Disabled by default - */ - useInitialLoading?: boolean; -} + extends CoreWatchQueryOptions {} export interface MutationOptions extends CoreMutationOptions { @@ -71,13 +63,6 @@ export interface WatchFragmentOptions export type NamedOptions = Record>; export type Flags = { - /** - * Observable starts with `{ loading: true }`. - * There's a big chance the next major version will enable that by default. - * - * Disabled by default - */ - useInitialLoading?: boolean; /** * Observable starts with `{ loading: true }`. * diff --git a/packages/apollo-angular/src/utils.ts b/packages/apollo-angular/src/utils.ts index 02f21136e..6c5ebb0e1 100644 --- a/packages/apollo-angular/src/utils.ts +++ b/packages/apollo-angular/src/utils.ts @@ -1,16 +1,13 @@ -import type { SchedulerAction, SchedulerLike, Subscription } from 'rxjs'; -import { Observable, observable, queueScheduler } from 'rxjs'; +import { Observable, queueScheduler, SchedulerAction, SchedulerLike, Subscription } from 'rxjs'; import { map, observeOn, startWith } from 'rxjs/operators'; import { NgZone } from '@angular/core'; -import type { - Observable as AObservable, - ApolloQueryResult, - FetchResult, - ObservableQuery, -} from '@apollo/client/core'; +import type { ApolloQueryResult, FetchResult, ObservableQuery } from '@apollo/client/core'; import { MutationResult } from './types'; -export function fromPromise(promiseFn: () => Promise): Observable { +/** + * Like RxJS's `fromPromise()`, but starts the promise only when the observable is subscribed to. + */ +export function fromLazyPromise(promiseFn: () => Promise): Observable { return new Observable(subscriber => { promiseFn().then( result => { @@ -54,7 +51,7 @@ export function useMutationLoading(source: Observable>, enable export class ZoneScheduler implements SchedulerLike { constructor(private readonly zone: NgZone) {} - public now = Date.now ? Date.now : () => +new Date(); + public readonly now = Date.now; public schedule( work: (this: SchedulerAction, state?: T) => void, @@ -65,16 +62,12 @@ export class ZoneScheduler implements SchedulerLike { } } -// XXX: Apollo's QueryObservable is not compatible with RxJS -// TODO: remove it in one of future releases -// https://github.com/ReactiveX/rxjs/blob/9fb0ce9e09c865920cf37915cc675e3b3a75050b/src/internal/util/subscribeTo.ts#L32 -export function fixObservable(obs: ObservableQuery): Observable>; -export function fixObservable(obs: AObservable): Observable; -export function fixObservable( - obs: AObservable | ObservableQuery, -): Observable> | Observable { - (obs as any)[observable] = () => obs; - return obs as any; +export function fromObservableQuery( + obsQuery: ObservableQuery, +): Observable> { + return new Observable(subscriber => { + return obsQuery.subscribe(subscriber); + }); } export function wrapWithZone(obs: Observable, ngZone: NgZone): Observable { diff --git a/packages/apollo-angular/testing/src/backend.ts b/packages/apollo-angular/testing/src/backend.ts index 245aadc08..908b89dc3 100644 --- a/packages/apollo-angular/testing/src/backend.ts +++ b/packages/apollo-angular/testing/src/backend.ts @@ -1,7 +1,7 @@ import { DocumentNode, print } from 'graphql'; -import { Observer } from 'rxjs'; +import { Observable, Observer } from 'rxjs'; import { Injectable } from '@angular/core'; -import { FetchResult, Observable as LinkObservable } from '@apollo/client/core'; +import { FetchResult } from '@apollo/client/core'; import { ApolloTestingController, MatchOperation } from './controller'; import { Operation, TestOperation } from './operation'; @@ -23,8 +23,8 @@ export class ApolloTestingBackend implements ApolloTestingController { /** * Handle an incoming operation by queueing it in the list of open operations. */ - public handle(op: Operation): LinkObservable { - return new LinkObservable((observer: Observer) => { + public handle(op: Operation): Observable { + return new Observable((observer: Observer) => { const testOp = new TestOperation(op, observer); this.open.push(testOp); }); diff --git a/packages/apollo-angular/testing/src/module.ts b/packages/apollo-angular/testing/src/module.ts index f5b3a3b53..f7d9de163 100644 --- a/packages/apollo-angular/testing/src/module.ts +++ b/packages/apollo-angular/testing/src/module.ts @@ -55,11 +55,7 @@ export class ApolloTestingModuleCore { return { connectToDevTools: false, link: new ApolloLink(operation => backend.handle(addClient(name, operation))), - cache: - c || - new InMemoryCache({ - addTypename: false, - }), + cache: c || new InMemoryCache(), }; } diff --git a/packages/apollo-angular/testing/tests/integration.spec.ts b/packages/apollo-angular/testing/tests/integration.spec.ts index 4143acc2a..b4452489b 100644 --- a/packages/apollo-angular/testing/tests/integration.spec.ts +++ b/packages/apollo-angular/testing/tests/integration.spec.ts @@ -1,16 +1,17 @@ import { print } from 'graphql'; import { afterEach, beforeEach, describe, expect, test } from 'vitest'; import { TestBed } from '@angular/core/testing'; -import { gql, InMemoryCache } from '@apollo/client/core'; +import { gql } from '@apollo/client/core'; import { addTypenameToDocument } from '@apollo/client/utilities'; import { Apollo } from '../../src'; -import { APOLLO_TESTING_CACHE, ApolloTestingController, ApolloTestingModule } from '../src'; +import { ApolloTestingController, ApolloTestingModule } from '../src'; describe('Integration', () => { let apollo: Apollo; let backend: ApolloTestingController; beforeEach(() => { + TestBed.resetTestingModule(); TestBed.configureTestingModule({ imports: [ApolloTestingModule], }); @@ -131,6 +132,7 @@ describe('Integration', () => { query heroes($first: Int!) { heroes(first: $first) { name + __typename } } `, @@ -171,17 +173,6 @@ describe('Integration', () => { test('it should be able to test with fragments', () => new Promise(done => { - TestBed.resetTestingModule(); - TestBed.configureTestingModule({ - imports: [ApolloTestingModule], - providers: [ - { - provide: APOLLO_TESTING_CACHE, - useValue: new InMemoryCache({ addTypename: true }), - }, - ], - }); - const apollo = TestBed.inject(Apollo); const backend = TestBed.inject(ApolloTestingController); diff --git a/packages/apollo-angular/testing/tests/module.spec.ts b/packages/apollo-angular/testing/tests/module.spec.ts index 6a27345f7..0ff46f824 100644 --- a/packages/apollo-angular/testing/tests/module.spec.ts +++ b/packages/apollo-angular/testing/tests/module.spec.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from 'vitest'; import { TestBed } from '@angular/core/testing'; -import { ApolloReducerConfig, gql, InMemoryCache } from '@apollo/client/core'; +import { gql, InMemoryCache } from '@apollo/client/core'; import { Apollo } from '../../src'; import { APOLLO_TESTING_CACHE, ApolloTestingController, ApolloTestingModule } from '../src'; @@ -12,14 +12,12 @@ describe('ApolloTestingModule', () => { const apollo = TestBed.inject(Apollo); const cache = apollo.client.cache as InMemoryCache; - const config: ApolloReducerConfig = (cache as any).config; expect(cache).toBeInstanceOf(InMemoryCache); - expect(config.addTypename).toBe(false); }); test('should allow to use custom ApolloCache', () => { - const cache = new InMemoryCache({ addTypename: true }); + const cache = new InMemoryCache(); TestBed.configureTestingModule({ imports: [ApolloTestingModule], diff --git a/packages/apollo-angular/tests/QueryRef.spec.ts b/packages/apollo-angular/tests/QueryRef.spec.ts index ba154f59f..b84d47223 100644 --- a/packages/apollo-angular/tests/QueryRef.spec.ts +++ b/packages/apollo-angular/tests/QueryRef.spec.ts @@ -59,7 +59,7 @@ describe('QueryRef', () => { client = createClient(mockedLink); obsQuery = client.watchQuery(heroesOperation); - queryRef = new QueryRef(obsQuery, ngZone, {} as any); + queryRef = new QueryRef(obsQuery, ngZone); }); test('should listen to changes', () => diff --git a/packages/demo/src/app/pages/movie/movie-page.component.ts b/packages/demo/src/app/pages/movie/movie-page.component.ts index 59c7c7291..d95842eab 100644 --- a/packages/demo/src/app/pages/movie/movie-page.component.ts +++ b/packages/demo/src/app/pages/movie/movie-page.component.ts @@ -74,6 +74,6 @@ export class MoviePageComponent implements OnInit { id: this.route.snapshot.paramMap.get('id')!, }, }) - .valueChanges.pipe(map(result => result.data.film)); + .valueChanges.pipe(map(result => result.data!.film)); } } diff --git a/packages/demo/src/app/pages/movies/movies-page.component.ts b/packages/demo/src/app/pages/movies/movies-page.component.ts index 86bb00e83..532bee1ff 100644 --- a/packages/demo/src/app/pages/movies/movies-page.component.ts +++ b/packages/demo/src/app/pages/movies/movies-page.component.ts @@ -56,6 +56,6 @@ export class MoviesPageComponent implements OnInit { } `, }) - .valueChanges.pipe(map(result => result.data.allFilms.films)) as any; + .valueChanges.pipe(map(result => result.data!.allFilms.films)) as any; } } diff --git a/website/src/pages/docs/caching/configuration.mdx b/website/src/pages/docs/caching/configuration.mdx index 1dcb2a3b6..0da05440e 100644 --- a/website/src/pages/docs/caching/configuration.mdx +++ b/website/src/pages/docs/caching/configuration.mdx @@ -61,7 +61,6 @@ object supports the following fields: | Name | Type | Description | | ----------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `addTypename` | boolean | If `true`, the cache automatically adds `__typename` fields to all outgoing queries, removing the need to add them manually.
Default: `true` | | `resultCaching` | boolean | If `true`, the cache returns an identical (`===`) response object for every execution of the same query, as long as the underlying data remains unchanged. This makes it easier to detect changes to a query's result.
Default: `true` | | `possibleTypes` | `{ [supertype: string]: string[] }` | Include this object to define polymorphic relationships between your schema's types. Doing so enables you to look up cached data by interface or by union.
The key for each entry is the `__typename` of an interface or union, and the value is an array of the `__typename`s of the types that either belong to the corresponding union or implement the corresponding interface. | | `typePolicies` | `{ [typename: string]: TypePolicy }` | Include this object to customize the cache's behavior on a type-by-type basis.
The key for each entry is a type's `__typename`. For details, see [`TypePolicy` fields](#typepolicy-fields). | diff --git a/website/src/pages/docs/development-and-testing/testing.mdx b/website/src/pages/docs/development-and-testing/testing.mdx index f12d5f2e2..685e40291 100644 --- a/website/src/pages/docs/development-and-testing/testing.mdx +++ b/website/src/pages/docs/development-and-testing/testing.mdx @@ -292,18 +292,13 @@ test('expect to call clientA', () => { ## Using a custom cache -By default, every ApolloCache is created with these options: - -```json -{ - "addTypename": false -} -``` - -If you would like to change it in the default client, do the following: +A `InMemoryCache` is provided by default. If you would like to change it in the default client, you +can provide the `APOLLO_TESTING_CACHE` token: ```ts -import { APOLLO_TESTING_CACHE } from 'apollo-angular/testing'; +import { APOLLO_TESTING_CACHE, ApolloTestingModule } from 'apollo-angular/testing'; +import { TestBed } from '@angular/core/testing'; +import { InMemoryCache } from '@apollo/client/core'; beforeEach(() => { TestBed.configureTestingModule({ @@ -311,9 +306,9 @@ beforeEach(() => { providers: [ { provide: APOLLO_TESTING_CACHE, - useValue: { - addTypename: true, - }, + useValue: new InMemoryCache({ + // Custom options here... + }), }, ], }); @@ -322,10 +317,12 @@ beforeEach(() => { }); ``` -For named clients: +And for named clients: ```ts -import { APOLLO_TESTING_NAMED_CACHE } from 'apollo-angular/testing'; +import { APOLLO_TESTING_NAMED_CACHE, ApolloTestingModule } from 'apollo-angular/testing'; +import { TestBed } from '@angular/core/testing'; +import { InMemoryCache } from '@apollo/client/core'; beforeEach(() => { TestBed.configureTestingModule({ @@ -334,12 +331,12 @@ beforeEach(() => { { provide: APOLLO_TESTING_NAMED_CACHE, useValue: { - clientA: { - addTypename: true, - }, - clientB: { - addTypename: true, - }, + clientA: new InMemoryCache({ + // Custom options for client A here... + }), + clientB: new InMemoryCache({ + // Custom options for client B here... + }), }, }, ], diff --git a/yarn.lock b/yarn.lock index 73814e014..cfd8f73b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -264,24 +264,32 @@ dependencies: tslib "^2.3.0" -"@apollo/client@^3.13.1": - version "3.13.1" - resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.13.1.tgz#c0633c69c5446967b0e517a590595eeea61dd176" - integrity sha512-HaAt62h3jNUXpJ1v5HNgUiCzPP1c5zc2Q/FeTb2cTk/v09YlhoqKKHQFJI7St50VCJ5q8JVIc03I5bRcBrQxsg== +"@apollo/client@https://pkg.pr.new/@apollo/client@12221": + version "4.0.0-alpha.0" + resolved "https://pkg.pr.new/@apollo/client@12221#d8a470f1993539909177eba396eb583572382185" + dependencies: + "@graphql-typed-document-node/core" "^3.1.1" + "@wry/caches" "^1.0.0" + "@wry/equality" "^0.5.6" + "@wry/trie" "^0.5.0" + graphql-tag "^2.12.6" + optimism "^0.18.0" + rehackt "^0.1.0" + tslib "^2.3.0" + +"@apollo/client@https://pkg.pr.new/@apollo/client@12384": + version "3.13.0" + resolved "https://pkg.pr.new/@apollo/client@12384#8fb6746f15541854a956115c6a8610e3da7858d8" dependencies: "@graphql-typed-document-node/core" "^3.1.1" "@wry/caches" "^1.0.0" "@wry/equality" "^0.5.6" "@wry/trie" "^0.5.0" graphql-tag "^2.12.6" - hoist-non-react-statics "^3.3.2" optimism "^0.18.0" - prop-types "^15.7.2" rehackt "^0.1.0" - symbol-observable "^4.0.0" ts-invariant "^0.10.3" tslib "^2.3.0" - zen-observable-ts "^1.2.5" "@asamuzakjp/css-color@^2.8.2": version "2.8.3" @@ -6255,13 +6263,6 @@ heap@^0.2.6: resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.7.tgz#1e6adf711d3f27ce35a81fe3b7bd576c2260a8fc" integrity sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg== -hoist-non-react-statics@^3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" - integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== - dependencies: - react-is "^16.7.0" - hosted-git-info@^7.0.0: version "7.0.2" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-7.0.2.tgz#9b751acac097757667f30114607ef7b661ff4f17" @@ -9787,7 +9788,7 @@ react-fast-compare@^3.0.1: resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49" integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ== -react-is@^16.13.1, react-is@^16.7.0: +react-is@^16.13.1: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -11003,7 +11004,7 @@ svgo@^3.2.0: csso "^5.0.5" picocolors "^1.0.0" -symbol-observable@4.0.0, symbol-observable@^4.0.0: +symbol-observable@4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205" integrity sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ== @@ -12106,18 +12107,6 @@ yocto-queue@^1.0.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.1.1.tgz#fef65ce3ac9f8a32ceac5a634f74e17e5b232110" integrity sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g== -zen-observable-ts@^1.2.5: - version "1.2.5" - resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz#6c6d9ea3d3a842812c6e9519209365a122ba8b58" - integrity sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg== - dependencies: - zen-observable "0.8.15" - -zen-observable@0.8.15: - version "0.8.15" - resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15" - integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ== - zod-validation-error@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-1.5.0.tgz#2b355007a1c3b7fb04fa476bfad4e7b3fd5491e3"