Skip to content

Commit 8bfee88

Browse files
authoredDec 12, 2024··
prevent infinite recursion of ContainsFragmentsRefs type (#12214)
1 parent 851deb0 commit 8bfee88

17 files changed

+100
-21
lines changed
 

‎.api-reports/api-report-cache.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,11 @@ type CombineIntersection<T> = Exclude<T, {
237237
}>>;
238238

239239
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
240+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
240241
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
241242
//
242243
// @public (undocumented)
243-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
244+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
244245

245246
// @public (undocumented)
246247
export function createFragmentRegistry(...fragments: DocumentNode[]): FragmentRegistryAPI;
@@ -465,6 +466,9 @@ export namespace EntityStore {
465466
}
466467
}
467468

469+
// @public (undocumented)
470+
type Exact<in out T> = (x: T) => T;
471+
468472
// @public
469473
type ExtractByMatchingTypeNames<Union extends {
470474
__typename?: string;

‎.api-reports/api-report-core.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -480,10 +480,11 @@ type ConcastSourcesIterable<T> = Iterable<Source<T>>;
480480
export const concat: typeof ApolloLink.concat;
481481

482482
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
483+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
483484
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
484485
//
485486
// @public (undocumented)
486-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
487+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
487488

488489
// @public (undocumented)
489490
export const createHttpLink: (linkOptions?: HttpOptions) => ApolloLink;
@@ -790,6 +791,9 @@ namespace EntityStore {
790791
// @public
791792
export type ErrorPolicy = "none" | "ignore" | "all";
792793

794+
// @public (undocumented)
795+
type Exact<in out T> = (x: T) => T;
796+
793797
// @public (undocumented)
794798
export const execute: typeof ApolloLink.execute;
795799

‎.api-reports/api-report-masking.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,11 @@ type CombineIntersection<T> = Exclude<T, {
221221
}>>;
222222

223223
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
224+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
224225
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
225226
//
226227
// @public (undocumented)
227-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
228+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
228229

229230
// @public (undocumented)
230231
export interface DataMasking {
@@ -360,6 +361,9 @@ export const disableWarningsSlot: {
360361
// @public (undocumented)
361362
type DistributedRequiredExclude<T, U> = T extends any ? Required<T> extends Required<U> ? Required<U> extends Required<T> ? never : T : T : T;
362363

364+
// @public (undocumented)
365+
type Exact<in out T> = (x: T) => T;
366+
363367
// @public
364368
type ExtractByMatchingTypeNames<Union extends {
365369
__typename?: string;

‎.api-reports/api-report-react.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,11 @@ class Concast<T> extends Observable<T> {
578578
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
579579

580580
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
581+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
581582
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
582583
//
583584
// @public (undocumented)
584-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
585+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
585586

586587
// @public (undocumented)
587588
export interface Context extends Record<string, any> {
@@ -779,6 +780,9 @@ export { DocumentType_2 as DocumentType }
779780
// @public
780781
type ErrorPolicy = "none" | "ignore" | "all";
781782

783+
// @public (undocumented)
784+
type Exact<in out T> = (x: T) => T;
785+
782786
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
783787
//
784788
// @public (undocumented)

‎.api-reports/api-report-react_components.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,11 @@ class Concast<T> extends Observable<T> {
524524
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
525525

526526
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
527+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
527528
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
528529
//
529530
// @public (undocumented)
530-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
531+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
531532

532533
// @public (undocumented)
533534
interface DataMasking {
@@ -711,6 +712,9 @@ interface DocumentTransformOptions {
711712
// @public
712713
type ErrorPolicy = "none" | "ignore" | "all";
713714

715+
// @public (undocumented)
716+
type Exact<in out T> = (x: T) => T;
717+
714718
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
715719
//
716720
// @public (undocumented)

‎.api-reports/api-report-react_context.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,11 @@ class Concast<T> extends Observable<T> {
518518
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
519519

520520
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
521+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
521522
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
522523
//
523524
// @public (undocumented)
524-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
525+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
525526

526527
// @public (undocumented)
527528
interface DataMasking {
@@ -705,6 +706,9 @@ interface DocumentTransformOptions {
705706
// @public
706707
type ErrorPolicy = "none" | "ignore" | "all";
707708

709+
// @public (undocumented)
710+
type Exact<in out T> = (x: T) => T;
711+
708712
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
709713
//
710714
// @public (undocumented)

‎.api-reports/api-report-react_hoc.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,11 @@ class Concast<T> extends Observable<T> {
507507
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
508508

509509
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
510+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
510511
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
511512
//
512513
// @public (undocumented)
513-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
514+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
514515

515516
// @public (undocumented)
516517
interface DataMasking {
@@ -703,6 +704,9 @@ interface DocumentTransformOptions {
703704
// @public
704705
type ErrorPolicy = "none" | "ignore" | "all";
705706

707+
// @public (undocumented)
708+
type Exact<in out T> = (x: T) => T;
709+
706710
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
707711
//
708712
// @public (undocumented)

‎.api-reports/api-report-react_hooks.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,11 @@ class Concast<T> extends Observable<T> {
547547
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
548548

549549
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
550+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
550551
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
551552
//
552553
// @public (undocumented)
553-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
554+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
554555

555556
// @public (undocumented)
556557
interface DataMasking {
@@ -734,6 +735,9 @@ interface DocumentTransformOptions {
734735
// @public
735736
type ErrorPolicy = "none" | "ignore" | "all";
736737

738+
// @public (undocumented)
739+
type Exact<in out T> = (x: T) => T;
740+
737741
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
738742
//
739743
// @public (undocumented)

‎.api-reports/api-report-react_internal.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -526,10 +526,11 @@ class Concast<T> extends Observable<T> {
526526
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
527527

528528
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
529+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
529530
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
530531
//
531532
// @public (undocumented)
532-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
533+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
533534

534535
// Warning: (ae-forgotten-export) The symbol "PreloadQueryFunction" needs to be exported by the entry point index.d.ts
535536
//
@@ -718,6 +719,9 @@ interface DocumentTransformOptions {
718719
// @public
719720
type ErrorPolicy = "none" | "ignore" | "all";
720721

722+
// @public (undocumented)
723+
type Exact<in out T> = (x: T) => T;
724+
721725
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
722726
//
723727
// @public (undocumented)

‎.api-reports/api-report-react_ssr.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -487,10 +487,11 @@ class Concast<T> extends Observable<T> {
487487
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
488488

489489
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
490+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
490491
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
491492
//
492493
// @public (undocumented)
493-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
494+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
494495

495496
// @public (undocumented)
496497
interface DataMasking {
@@ -674,6 +675,9 @@ interface DocumentTransformOptions {
674675
// @public
675676
type ErrorPolicy = "none" | "ignore" | "all";
676677

678+
// @public (undocumented)
679+
type Exact<in out T> = (x: T) => T;
680+
677681
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
678682
//
679683
// @public (undocumented)

‎.api-reports/api-report-testing.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -477,10 +477,11 @@ class Concast<T> extends Observable<T> {
477477
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
478478

479479
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
480+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
480481
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
481482
//
482483
// @public (undocumented)
483-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
484+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
484485

485486
// @internal (undocumented)
486487
type CovariantUnaryFunction<out Arg, out Ret> = {
@@ -675,6 +676,9 @@ interface DocumentTransformOptions {
675676
// @public
676677
type ErrorPolicy = "none" | "ignore" | "all";
677678

679+
// @public (undocumented)
680+
type Exact<in out T> = (x: T) => T;
681+
678682
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
679683
//
680684
// @public (undocumented)

‎.api-reports/api-report-testing_core.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,11 @@ class Concast<T> extends Observable<T> {
476476
type ConcastSourcesIterable<T> = Iterable<Source<T>>;
477477

478478
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
479+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
479480
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
480481
//
481482
// @public (undocumented)
482-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
483+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
483484

484485
// @internal (undocumented)
485486
type CovariantUnaryFunction<out Arg, out Ret> = {
@@ -674,6 +675,9 @@ interface DocumentTransformOptions {
674675
// @public
675676
type ErrorPolicy = "none" | "ignore" | "all";
676677

678+
// @public (undocumented)
679+
type Exact<in out T> = (x: T) => T;
680+
677681
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
678682
//
679683
// @public (undocumented)

‎.api-reports/api-report-utilities.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -607,9 +607,10 @@ export type ConcastSourcesIterable<T> = Iterable<Source<T>>;
607607
export function concatPagination<T = Reference>(keyArgs?: KeyArgs): FieldPolicy<T[]>;
608608

609609
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
610+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
610611
//
611612
// @public (undocumented)
612-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
613+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
613614

614615
// @public (undocumented)
615616
export function createFragmentMap(fragments?: FragmentDefinitionNode[]): FragmentMap;
@@ -981,6 +982,9 @@ namespace EntityStore {
981982
// @public
982983
type ErrorPolicy = "none" | "ignore" | "all";
983984

985+
// @public (undocumented)
986+
type Exact<in out T> = (x: T) => T;
987+
984988
// Warning: (ae-forgotten-export) The symbol "ExecutionPatchResultBase" needs to be exported by the entry point index.d.ts
985989
//
986990
// @public (undocumented)

‎.api-reports/api-report.api.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,11 @@ type ConcastSourcesIterable<T> = Iterable<Source<T>>;
577577
export const concat: typeof ApolloLink.concat;
578578

579579
// Warning: (ae-forgotten-export) The symbol "IsAny" needs to be exported by the entry point index.d.ts
580+
// Warning: (ae-forgotten-export) The symbol "Exact" needs to be exported by the entry point index.d.ts
580581
// Warning: (ae-forgotten-export) The symbol "RemoveIndexSignature" needs to be exported by the entry point index.d.ts
581582
//
582583
// @public (undocumented)
583-
type ContainsFragmentsRefs<TData> = true extends IsAny<TData> ? false : TData extends object ? " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData]> : false;
584+
type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ? false : TData extends object ? Exact<TData> extends Seen ? false : " $fragmentRefs" extends keyof RemoveIndexSignature<TData> ? true : ContainsFragmentsRefs<TData[keyof TData], Seen | Exact<TData>> : false;
584585

585586
// @public (undocumented)
586587
export const createHttpLink: (linkOptions?: HttpOptions) => ApolloLink;
@@ -903,6 +904,9 @@ namespace EntityStore {
903904
// @public
904905
export type ErrorPolicy = "none" | "ignore" | "all";
905906

907+
// @public (undocumented)
908+
type Exact<in out T> = (x: T) => T;
909+
906910
// @public (undocumented)
907911
export const execute: typeof ApolloLink.execute;
908912

‎.changeset/chilly-icons-shave.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@apollo/client": patch
3+
---
4+
5+
Data masking: prevent infinite recursion of `ContainsFragmentsRefs` type

‎src/masking/__benches__/types.bench.ts

+15
Original file line numberDiff line numberDiff line change
@@ -577,3 +577,18 @@ test("detects `$fragmentRefs` on types with index signatures", (prefix) => {
577577
}>();
578578
});
579579
});
580+
581+
test("recursive types: no error 'Type instantiation is excessively deep and possibly infinite.'", (prefix) => {
582+
// this type is self-recursive
583+
type Source = import("graphql").IntrospectionQuery;
584+
585+
bench(prefix + "instantiations", () => {
586+
return {} as MaybeMasked<Source>;
587+
}).types([6, "instantiations"]);
588+
589+
bench(prefix + "functionality", () => {
590+
const x = {} as MaybeMasked<Source>;
591+
592+
expectTypeOf(x).branded.toEqualTypeOf<Source>();
593+
});
594+
});

0 commit comments

Comments
 (0)
Please sign in to comment.