Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c4558e4
Remove MaskedDocumentNode type
jerelmiller Aug 8, 2025
110aed3
Remove use of MaskedDocumentNode from tests
jerelmiller Aug 8, 2025
eb5bf8d
Remove mask mode from masking algorithm
jerelmiller Aug 8, 2025
389864f
Remove Masked type
jerelmiller Aug 8, 2025
0a8e638
Remove use of Masked type from tests
jerelmiller Aug 8, 2025
5baea50
Rename Unmasked to Unmask. Deprecate Unmasked
jerelmiller Aug 8, 2025
7b72b90
Move Unmasked to deprecated file
jerelmiller Aug 8, 2025
ca5e7aa
Use Unmask for key in HKT
jerelmiller Aug 8, 2025
227b1c6
remove RemoveMaskedMarker type
jerelmiller Aug 8, 2025
2a4e123
Add an IsMasked type for extension. Update MaybeMasked to use IsMaske…
jerelmiller Aug 8, 2025
a46966d
Use PreserveTypes as default implementation
jerelmiller Aug 8, 2025
7a0b38b
Use GraphQL Codegen format in tests
jerelmiller Aug 8, 2025
81324d2
Set FragmentType to never for default implementation
jerelmiller Aug 8, 2025
e5a7989
Update api report
jerelmiller Aug 8, 2025
ea2272e
Use import type
jerelmiller Aug 8, 2025
5b881a8
Add changesets
jerelmiller Aug 8, 2025
f4a261c
Export Mask and IsMasked from core
jerelmiller Aug 8, 2025
1fcbdd3
Update enhanceMaskingTypes
jerelmiller Aug 8, 2025
d4d83cc
Remove types mode from docs
jerelmiller Aug 8, 2025
8291993
Rename IsMasked to IsMaskingEnabled. Don't export it
jerelmiller Aug 8, 2025
ddc5ac7
Remove IsMaskingEnabled type. Alias MaybeMasked to Mask
jerelmiller Aug 8, 2025
7479a06
Add remarks
jerelmiller Aug 8, 2025
c1f3c94
Tweak doc blocks
jerelmiller Aug 8, 2025
6d33fe3
chores
jerelmiller Aug 8, 2025
6e74f21
Update changeset
jerelmiller Aug 8, 2025
bfcfc90
Rename Unmask back to Unmasked. Remove Mask in favor of MaybeMasked.
jerelmiller Aug 8, 2025
2650e76
Update api report
jerelmiller Aug 8, 2025
876ce41
Update changesets
jerelmiller Aug 8, 2025
0968c86
Revert to original names
jerelmiller Aug 8, 2025
7ed5f3d
Remove changeset
jerelmiller Aug 8, 2025
46f23ce
Rerun api report
jerelmiller Aug 8, 2025
d1f5dad
Rename GraphQLCodegenDataMasking.Implementation interface to TypeOver…
jerelmiller Aug 8, 2025
69bf371
Update api report
jerelmiller Aug 8, 2025
dbe61c5
Rename PreserveTypes.Implementation to TypeOverrides
jerelmiller Aug 8, 2025
6fb7fa6
Update api report
jerelmiller Aug 8, 2025
f1fea39
Update integration test
jerelmiller Aug 8, 2025
32e24f2
Update src/masking/PreserveTypes.ts
phryneas Aug 13, 2025
9a7c492
Clean up Prettier, Size-limit, and Api-Extractor
phryneas Aug 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .api-reports/api-report-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ import { LinkError } from '@apollo/client/errors';
import type { LocalState } from '@apollo/client/local-state';
import { LocalStateError } from '@apollo/client/errors';
import { makeVar } from '@apollo/client/cache';
import { Masked } from '@apollo/client/masking';
import { MaskedDocumentNode } from '@apollo/client/masking';
import { MaybeMasked } from '@apollo/client/masking';
import { MergeInfo } from '@apollo/client/cache';
import { MergeTree } from '@apollo/client/cache';
Expand Down Expand Up @@ -545,10 +543,6 @@ export { LocalStateError }

export { makeVar }

export { Masked }

export { MaskedDocumentNode }

// @public (undocumented)
interface MaskFragmentOptions<TData> {
// (undocumented)
Expand Down
116 changes: 54 additions & 62 deletions .api-reports/api-report-masking.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@

import type { ApolloCache } from '@apollo/client';
import type { ApplyHKTImplementationWithDefault } from '@apollo/client/utilities/internal';
import type { DataMasking as DataMasking_2 } from '@apollo/client';
import type { DocumentNode } from '@apollo/client';
import type { HKT } from '@apollo/client/utilities';
import type { IsAny } from '@apollo/client/utilities/internal';
import type { Prettify } from '@apollo/client/utilities/internal';
import type { Primitive } from '@apollo/client/utilities/internal';
import type { RemoveIndexSignature } from '@apollo/client/utilities/internal';
import type { TypedDocumentNode } from '@graphql-typed-document-node/core';
import type { TypedDocumentNode as TypedDocumentNode_2 } from '@apollo/client';
import type { TypedDocumentNode } from '@apollo/client';
import type { TypeOverrides } from '@apollo/client';

// Warning: (ae-forgotten-export) The symbol "MergeUnions" needs to be exported by the entry point index.d.ts
Expand Down Expand Up @@ -45,9 +43,6 @@ type ContainsFragmentsRefs<TData, Seen = never> = true extends (IsAny<TData>) ?
export interface DataMasking {
}

// @public (undocumented)
type DefaultImplementation = GraphQLCodegenDataMasking.Implementation;

// @internal @deprecated (undocumented)
export const disableWarningsSlot: {
readonly id: string;
Expand All @@ -69,10 +64,10 @@ type ExtractByMatchingTypeNames<Union extends {
[K in keyof Union as K extends "__typename" ? K : never]: TypeName;
} : never : never;

// Warning: (ae-forgotten-export) The symbol "DefaultImplementation" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "PreserveTypes" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export type FragmentType<TData> = ApplyHKTImplementationWithDefault<TypeOverrides, "FragmentType", DefaultImplementation, TData>;
export type FragmentType<TData> = ApplyHKTImplementationWithDefault<TypeOverrides, "FragmentType", PreserveTypes.TypeOverrides, TData>;

// @public (undocumented)
export namespace GraphQLCodegenDataMasking {
Expand All @@ -96,22 +91,6 @@ export namespace GraphQLCodegenDataMasking {
return: GraphQLCodegenDataMasking.FragmentType<this["arg1"]>;
}
// (undocumented)
export interface Masked extends HKT {
// (undocumented)
arg1: unknown;
// (undocumented)
return: GraphQLCodegenDataMasking.Masked<this["arg1"]>;
}
// (undocumented)
export interface MaskedDocumentNode extends HKT {
// (undocumented)
arg1: unknown;
// (undocumented)
arg2: unknown;
// (undocumented)
return: GraphQLCodegenDataMasking.MaskedDocumentNode<this["arg1"], this["arg2"]>;
}
// (undocumented)
export interface MaybeMasked extends HKT {
// (undocumented)
arg1: unknown;
Expand All @@ -126,59 +105,30 @@ export namespace GraphQLCodegenDataMasking {
return: GraphQLCodegenDataMasking.Unmasked<this["arg1"]>;
}
}
export type MaybeMasked<TData> = TData;
// (undocumented)
export interface Implementation {
export interface TypeOverrides {
// (undocumented)
FragmentType: HKTImplementation.FragmentType;
// (undocumented)
Masked: HKTImplementation.Masked;
// (undocumented)
MaskedDocumentNode: HKTImplementation.MaskedDocumentNode;
// (undocumented)
MaybeMasked: HKTImplementation.MaybeMasked;
// (undocumented)
Unmasked: HKTImplementation.Unmasked;
}
export type Masked<TData> = TData & {
__masked?: true;
};
export type MaskedDocumentNode<TData = {
[key: string]: any;
}, TVariables = {
[key: string]: any;
}> = TypedDocumentNode<Masked<TData>, TVariables>;
// Warning: (ae-forgotten-export) The symbol "RemoveMaskedMarker" needs to be exported by the entry point index.d.ts
export type MaybeMasked<TData> = DataMasking_2 extends {
mode: "unmask";
} ? TData extends any ? true extends IsAny<TData> ? TData : TData extends {
__masked?: true;
} ? Prettify<RemoveMaskedMarker<TData>> : Unmasked<TData> : never : DataMasking_2 extends {
mode: "preserveTypes";
} ? TData : TData;
// Warning: (ae-forgotten-export) The symbol "ContainsFragmentsRefs" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "UnwrapFragmentRefs" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "RemoveFragmentName" needs to be exported by the entry point index.d.ts
export type Unmasked<TData> = true extends IsAny<TData> ? TData : TData extends object ? true extends ContainsFragmentsRefs<TData> ? UnwrapFragmentRefs<RemoveMaskedMarker<RemoveFragmentName<TData>>> : TData : TData;
export type Unmasked<TData> = true extends IsAny<TData> ? TData : TData extends object ? true extends ContainsFragmentsRefs<TData> ? UnwrapFragmentRefs<RemoveFragmentName<TData>> : TData : TData;
}

// @public
export type Masked<TData> = ApplyHKTImplementationWithDefault<TypeOverrides, "Masked", DefaultImplementation, TData>;

// @public
export type MaskedDocumentNode<TData = {
[key: string]: any;
}, TVariables = {
[key: string]: any;
}> = ApplyHKTImplementationWithDefault<TypeOverrides, "MaskedDocumentNode", DefaultImplementation, TData, TVariables>;

// @internal @deprecated (undocumented)
export function maskFragment<TData = unknown>(data: TData, document: TypedDocumentNode_2<TData> | DocumentNode, cache: ApolloCache, fragmentName?: string): TData;
export function maskFragment<TData = unknown>(data: TData, document: TypedDocumentNode<TData> | DocumentNode, cache: ApolloCache, fragmentName?: string): TData;

// @internal @deprecated (undocumented)
export function maskOperation<TData = unknown>(data: TData, document: DocumentNode | TypedDocumentNode_2<TData>, cache: ApolloCache): TData;
export function maskOperation<TData = unknown>(data: TData, document: DocumentNode | TypedDocumentNode<TData>, cache: ApolloCache): TData;

// @public
export type MaybeMasked<TData> = ApplyHKTImplementationWithDefault<TypeOverrides, "MaybeMasked", DefaultImplementation, TData>;
export type MaybeMasked<TData> = ApplyHKTImplementationWithDefault<TypeOverrides, "MaybeMasked", PreserveTypes.TypeOverrides, TData>;

// Warning: (ae-forgotten-export) The symbol "CombineIntersection" needs to be exported by the entry point index.d.ts
//
Expand Down Expand Up @@ -210,10 +160,52 @@ Merged
] extends [never] ? Curr : MergeObjects<Curr, Merged>>;

// @public (undocumented)
type RemoveFragmentName<T> = T extends any ? Omit<T, " $fragmentName"> : T;
namespace PreserveTypes {
// (undocumented)
type FragmentType<_TData> = never;
// (undocumented)
namespace HKTImplementation {
// (undocumented)
interface FragmentType extends HKT {
// (undocumented)
arg1: unknown;
// (undocumented)
return: never;
}
// (undocumented)
interface MaybeMasked extends HKT {
// (undocumented)
arg1: unknown;
// (undocumented)
return: this["arg1"];
}
// (undocumented)
interface Unmasked extends HKT {
// (undocumented)
arg1: unknown;
// (undocumented)
return: this["arg1"];
}
}
// (undocumented)
type MaybeMasked<TData> = TData;
// (undocumented)
interface TypeOverrides {
// Warning: (ae-forgotten-export) The symbol "PreserveTypes" needs to be exported by the entry point index.d.ts
//
// (undocumented)
FragmentType: HKTImplementation.FragmentType;
// (undocumented)
MaybeMasked: HKTImplementation.MaybeMasked;
// (undocumented)
Unmasked: HKTImplementation.Unmasked;
}
// (undocumented)
type Unmasked<TData> = TData;
}

// @public (undocumented)
type RemoveMaskedMarker<T> = Omit<T, "__masked">;
type RemoveFragmentName<T> = T extends any ? Omit<T, " $fragmentName"> : T;

// Warning: (ae-forgotten-export) The symbol "unionToIntersection" needs to be exported by the entry point index.d.ts
//
Expand All @@ -224,7 +216,7 @@ type takeOneFromUnion<T> = unionToIntersection<T extends T ? (x: T) => 0 : never
type unionToIntersection<T> = (T extends unknown ? (x: T) => unknown : never) extends ((x: infer U) => unknown) ? U : never;

// @public
export type Unmasked<TData> = ApplyHKTImplementationWithDefault<TypeOverrides, "Unmasked", DefaultImplementation, TData>;
export type Unmasked<TData> = ApplyHKTImplementationWithDefault<TypeOverrides, "Unmasked", PreserveTypes.TypeOverrides, TData>;

// @public (undocumented)
type UnwrapFragmentRefs<TData> = true extends IsAny<TData> ? TData : TData extends any ? TData extends Primitive ? TData : string extends keyof TData ? TData : keyof TData extends never ? TData : TData extends {
Expand Down
Loading