Skip to content

Commit 7931818

Browse files
committed
Use PR preview release
1 parent 34ab338 commit 7931818

File tree

7 files changed

+30
-70
lines changed

7 files changed

+30
-70
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@angular/platform-browser-dynamic": "^18.0.0",
3838
"@angular/platform-server": "^18.0.0",
3939
"@angular/router": "^18.0.0",
40-
"@apollo/client": "^3.13.1",
40+
"@apollo/client": "https://pkg.pr.new/@apollo/client@12384",
4141
"@babel/core": "^7.24.6",
4242
"@babel/preset-env": "^7.24.6",
4343
"@changesets/changelog-github": "^0.5.0",

packages/apollo-angular/persisted-queries/tests/persisted-queries.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { describe, expect, test, vi } from 'vitest';
2-
import { ApolloLink, execute, FetchResult, gql, Observable, Operation } from '@apollo/client/core';
2+
import { ApolloLink, execute, FetchResult, gql, Operation } from '@apollo/client/core';
33
import { createPersistedQueryLink } from '../src';
4+
import {Observable} from "rxjs";
45

56
const query = gql`
67
query heroes {

packages/apollo-angular/testing/tests/integration.spec.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { print } from 'graphql';
22
import { afterEach, beforeEach, describe, expect, test } from 'vitest';
33
import { TestBed } from '@angular/core/testing';
4-
import { gql, InMemoryCache } from '@apollo/client/core';
4+
import { gql } from '@apollo/client/core';
55
import { addTypenameToDocument } from '@apollo/client/utilities';
66
import { Apollo } from '../../src';
7-
import { APOLLO_TESTING_CACHE, ApolloTestingController, ApolloTestingModule } from '../src';
7+
import { ApolloTestingController, ApolloTestingModule } from '../src';
88

99
describe('Integration', () => {
1010
let apollo: Apollo;
@@ -171,17 +171,6 @@ describe('Integration', () => {
171171

172172
test('it should be able to test with fragments', () =>
173173
new Promise<void>(done => {
174-
TestBed.resetTestingModule();
175-
TestBed.configureTestingModule({
176-
imports: [ApolloTestingModule],
177-
providers: [
178-
{
179-
provide: APOLLO_TESTING_CACHE,
180-
useValue: new InMemoryCache({ addTypename: true }),
181-
},
182-
],
183-
});
184-
185174
const apollo = TestBed.inject(Apollo);
186175
const backend = TestBed.inject(ApolloTestingController);
187176

packages/apollo-angular/testing/tests/module.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { describe, expect, test } from 'vitest';
22
import { TestBed } from '@angular/core/testing';
3-
import { ApolloReducerConfig, gql, InMemoryCache } from '@apollo/client/core';
3+
import { gql, InMemoryCache } from '@apollo/client/core';
44
import { Apollo } from '../../src';
55
import { APOLLO_TESTING_CACHE, ApolloTestingController, ApolloTestingModule } from '../src';
66

@@ -12,14 +12,12 @@ describe('ApolloTestingModule', () => {
1212

1313
const apollo = TestBed.inject(Apollo);
1414
const cache = apollo.client.cache as InMemoryCache;
15-
const config: ApolloReducerConfig = (cache as any).config;
1615

1716
expect(cache).toBeInstanceOf(InMemoryCache);
18-
expect(config.addTypename).toBe(false);
1917
});
2018

2119
test('should allow to use custom ApolloCache', () => {
22-
const cache = new InMemoryCache({ addTypename: true });
20+
const cache = new InMemoryCache();
2321

2422
TestBed.configureTestingModule({
2523
imports: [ApolloTestingModule],

website/src/pages/docs/caching/configuration.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ object supports the following fields:
6161

6262
| Name | Type | Description |
6363
| ----------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
64-
| `addTypename` | boolean | If `true`, the cache automatically adds `__typename` fields to all outgoing queries, removing the need to add them manually.<br/>Default: `true` |
6564
| `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.<br/>Default: `true` |
6665
| `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.<br/>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. |
6766
| `typePolicies` | `{ [typename: string]: TypePolicy }` | Include this object to customize the cache's behavior on a type-by-type basis.<br/>The key for each entry is a type's `__typename`. For details, see [`TypePolicy` fields](#typepolicy-fields). |

website/src/pages/docs/development-and-testing/testing.mdx

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -292,28 +292,23 @@ test('expect to call clientA', () => {
292292

293293
## Using a custom cache
294294

295-
By default, every ApolloCache is created with these options:
296-
297-
```json
298-
{
299-
"addTypename": false
300-
}
301-
```
302-
303-
If you would like to change it in the default client, do the following:
295+
A `InMemoryCache` is provided by default. If you would like to change it in the default client, you
296+
can provide the `APOLLO_TESTING_CACHE` token:
304297

305298
```ts
306-
import { APOLLO_TESTING_CACHE } from 'apollo-angular/testing';
299+
import { APOLLO_TESTING_CACHE, ApolloTestingModule } from 'apollo-angular/testing';
300+
import { TestBed } from '@angular/core/testing';
301+
import { InMemoryCache } from '@apollo/client/core';
307302

308303
beforeEach(() => {
309304
TestBed.configureTestingModule({
310305
imports: [ApolloTestingModule],
311306
providers: [
312307
{
313308
provide: APOLLO_TESTING_CACHE,
314-
useValue: {
315-
addTypename: true,
316-
},
309+
useValue: new InMemoryCache({
310+
// Custom options here...
311+
}),
317312
},
318313
],
319314
});
@@ -322,10 +317,12 @@ beforeEach(() => {
322317
});
323318
```
324319

325-
For named clients:
320+
And for named clients:
326321

327322
```ts
328-
import { APOLLO_TESTING_NAMED_CACHE } from 'apollo-angular/testing';
323+
import { APOLLO_TESTING_NAMED_CACHE, ApolloTestingModule } from 'apollo-angular/testing';
324+
import { TestBed } from '@angular/core/testing';
325+
import { InMemoryCache } from '@apollo/client/core';
329326

330327
beforeEach(() => {
331328
TestBed.configureTestingModule({
@@ -334,12 +331,12 @@ beforeEach(() => {
334331
{
335332
provide: APOLLO_TESTING_NAMED_CACHE,
336333
useValue: {
337-
clientA: {
338-
addTypename: true,
339-
},
340-
clientB: {
341-
addTypename: true,
342-
},
334+
clientA: new InMemoryCache({
335+
// Custom options for client A here...
336+
}),
337+
clientB: new InMemoryCache({
338+
// Custom options for client B here...
339+
}),
343340
},
344341
},
345342
],

yarn.lock

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -264,24 +264,19 @@
264264
dependencies:
265265
tslib "^2.3.0"
266266

267-
"@apollo/client@^3.13.1":
268-
version "3.13.1"
269-
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.13.1.tgz#c0633c69c5446967b0e517a590595eeea61dd176"
270-
integrity sha512-HaAt62h3jNUXpJ1v5HNgUiCzPP1c5zc2Q/FeTb2cTk/v09YlhoqKKHQFJI7St50VCJ5q8JVIc03I5bRcBrQxsg==
267+
"@apollo/client@https://pkg.pr.new/@apollo/client@12384":
268+
version "3.13.0"
269+
resolved "https://pkg.pr.new/@apollo/client@12384#8fb6746f15541854a956115c6a8610e3da7858d8"
271270
dependencies:
272271
"@graphql-typed-document-node/core" "^3.1.1"
273272
"@wry/caches" "^1.0.0"
274273
"@wry/equality" "^0.5.6"
275274
"@wry/trie" "^0.5.0"
276275
graphql-tag "^2.12.6"
277-
hoist-non-react-statics "^3.3.2"
278276
optimism "^0.18.0"
279-
prop-types "^15.7.2"
280277
rehackt "^0.1.0"
281-
symbol-observable "^4.0.0"
282278
ts-invariant "^0.10.3"
283279
tslib "^2.3.0"
284-
zen-observable-ts "^1.2.5"
285280

286281
"@asamuzakjp/css-color@^2.8.2":
287282
version "2.8.3"
@@ -6255,13 +6250,6 @@ heap@^0.2.6:
62556250
resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.7.tgz#1e6adf711d3f27ce35a81fe3b7bd576c2260a8fc"
62566251
integrity sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==
62576252

6258-
hoist-non-react-statics@^3.3.2:
6259-
version "3.3.2"
6260-
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
6261-
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
6262-
dependencies:
6263-
react-is "^16.7.0"
6264-
62656253
hosted-git-info@^7.0.0:
62666254
version "7.0.2"
62676255
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-7.0.2.tgz#9b751acac097757667f30114607ef7b661ff4f17"
@@ -9787,7 +9775,7 @@ react-fast-compare@^3.0.1:
97879775
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49"
97889776
integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==
97899777

9790-
react-is@^16.13.1, react-is@^16.7.0:
9778+
react-is@^16.13.1:
97919779
version "16.13.1"
97929780
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
97939781
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@@ -11003,7 +10991,7 @@ svgo@^3.2.0:
1100310991
csso "^5.0.5"
1100410992
picocolors "^1.0.0"
1100510993

11006-
[email protected], symbol-observable@^4.0.0:
10994+
1100710995
version "4.0.0"
1100810996
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-4.0.0.tgz#5b425f192279e87f2f9b937ac8540d1984b39205"
1100910997
integrity sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==
@@ -12106,18 +12094,6 @@ yocto-queue@^1.0.0:
1210612094
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.1.1.tgz#fef65ce3ac9f8a32ceac5a634f74e17e5b232110"
1210712095
integrity sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==
1210812096

12109-
zen-observable-ts@^1.2.5:
12110-
version "1.2.5"
12111-
resolved "https://registry.yarnpkg.com/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz#6c6d9ea3d3a842812c6e9519209365a122ba8b58"
12112-
integrity sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==
12113-
dependencies:
12114-
zen-observable "0.8.15"
12115-
12116-
12117-
version "0.8.15"
12118-
resolved "https://registry.yarnpkg.com/zen-observable/-/zen-observable-0.8.15.tgz#96415c512d8e3ffd920afd3889604e30b9eaac15"
12119-
integrity sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==
12120-
1212112097
zod-validation-error@^1.5.0:
1212212098
version "1.5.0"
1212312099
resolved "https://registry.yarnpkg.com/zod-validation-error/-/zod-validation-error-1.5.0.tgz#2b355007a1c3b7fb04fa476bfad4e7b3fd5491e3"

0 commit comments

Comments
 (0)