Skip to content

Commit

Permalink
Update mapped-types.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec authored May 14, 2020
1 parent 417c115 commit 8868b4a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/graphql/mapped-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ We can pick a set of properties from this class using the `PickType()` utility f

```typescript
@InputType()
export class UpdateEmailInput extends PickType(CreateUserInput, ['email']) {}
export class UpdateEmailInput extends PickType(CreateUserInput, ['email'] as const) {}
```

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

```typescript
@InputType()
export class UpdateUserInput extends OmitType(CreateUserInput, ['email']) {}
export class UpdateUserInput extends OmitType(CreateUserInput, ['email'] as const) {}
```

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

0 comments on commit 8868b4a

Please sign in to comment.