Skip to content

Commit 03d5c0e

Browse files
2 parents 8ac6e86 + 474491c commit 03d5c0e

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

content/security/cors.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,3 @@ Or, pass a [CORS configuration object](https://github.com/expressjs/cors#configu
2121
const app = await NestFactory.create(AppModule, { cors: true });
2222
await app.listen(3000);
2323
```
24-
25-
Above method only applies to REST endpoints.
26-
27-
To enable CORS in GraphQL, set `cors` property to `true` or pass [CORS configuration object](https://github.com/expressjs/cors#configuration-options) or a [callback function](https://github.com/expressjs/cors#configuring-cors-asynchronously) as the `cors` property value when you import GraphQL module.
28-
29-
> warning **Warning** `CorsOptionsDelegate` solution is not working with the `apollo-server-fastify` package yet.
30-
31-
```typescript
32-
GraphQLModule.forRoot({
33-
cors: {
34-
origin: 'http://localhost:3000',
35-
credentials: true,
36-
},
37-
}),
38-
```

content/techniques/serialization.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Serialization is a process that happens before objects are returned in a network
66

77
Nest provides a built-in capability to help ensure that these operations can be performed in a straightforward way. The `ClassSerializerInterceptor` interceptor uses the powerful [class-transformer](https://github.com/typestack/class-transformer) package to provide a declarative and extensible way of transforming objects. The basic operation it performs is to take the value returned by a method handler and apply the `instanceToPlain()` function from [class-transformer](https://github.com/typestack/class-transformer). In doing so, it can apply rules expressed by `class-transformer` decorators on an entity/DTO class, as described below.
88

9+
> info **Hint** The serialization does not apply to [StreamableFile](https://docs.nestjs.com/techniques/streaming-files#streamable-file-class) responses.
10+
911
#### Exclude properties
1012

1113
Let's assume that we want to automatically exclude a `password` property from a user entity. We annotate the entity as follows:

0 commit comments

Comments
 (0)