Skip to content

Commit 8868b4a

Browse files
Update mapped-types.md
1 parent 417c115 commit 8868b4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/graphql/mapped-types.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ We can pick a set of properties from this class using the `PickType()` utility f
6464

6565
```typescript
6666
@InputType()
67-
export class UpdateEmailInput extends PickType(CreateUserInput, ['email']) {}
67+
export class UpdateEmailInput extends PickType(CreateUserInput, ['email'] as const) {}
6868
```
6969

7070
> info **Hint** The `PickType()` function is imported from the `@nestjs/graphql` package.
@@ -91,7 +91,7 @@ We can generate a derived type that has every property **except** `email` as sho
9191

9292
```typescript
9393
@InputType()
94-
export class UpdateUserInput extends OmitType(CreateUserInput, ['email']) {}
94+
export class UpdateUserInput extends OmitType(CreateUserInput, ['email'] as const) {}
9595
```
9696

9797
> info **Hint** The `OmitType()` function is imported from the `@nestjs/graphql` package.
@@ -136,6 +136,6 @@ The type mapping utility functions are composable. For example, the following wi
136136
```typescript
137137
@InputType()
138138
export class UpdateUserInput extends PartialType(
139-
OmitType(CreateUserInput, ['email']),
139+
OmitType(CreateUserInput, ['email'] as const),
140140
) {}
141141
```

0 commit comments

Comments
 (0)