Skip to content

Commit

Permalink
Allow DeepOmit to support partial (#12392)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joja81 authored Mar 5, 2025
1 parent 6fcad3b commit 644bb26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/grumpy-donuts-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Fixes an issue where the DeepOmit type would turn optional properties into required properties. This should only affect you if you were using the omitDeep or stripTypename utilities exported by Apollo Client.
2 changes: 1 addition & 1 deletion src/utilities/types/DeepOmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export type DeepOmitArray<T extends any[], K> = {
export type DeepOmit<T, K> =
T extends DeepOmitPrimitive ? T
: {
[P in Exclude<keyof T, K>]: T[P] extends infer TP ?
[P in keyof T as P extends K ? never : P]: T[P] extends infer TP ?
TP extends DeepOmitPrimitive ? TP
: TP extends any[] ? DeepOmitArray<TP, K>
: DeepOmit<TP, K>
Expand Down

0 comments on commit 644bb26

Please sign in to comment.