Skip to content

Commit cf48eba

Browse files
2 parents d830187 + aeda6ee commit cf48eba

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

content/controllers.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ findOne(params) {
289289
```typescript
290290
@@filename()
291291
@Get(':id')
292-
findOne(@Param('id') id): string {
292+
findOne(@Param('id') id: string): string {
293293
return `This action returns a #${id} cat`;
294294
}
295295
@@switch
@@ -483,6 +483,8 @@ export class CatsController {
483483
}
484484
```
485485

486+
> info **Hint** Nest CLI provides a generator (schematic) that automatically generates **all the boilerplate code** to help us avoid doing all of this, and make the developer experience much simpler. Read more about this feature [here](/recipes/crud-generator).
487+
486488
#### Getting up and running
487489

488490
With the above controller fully defined, Nest still doesn't know that `CatsController` exists and as a result won't create an instance of this class.

content/graphql/resolvers-map.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export class AuthorsResolver {
154154
}
155155
```
156156

157+
157158
> info **Hint** All decorators (e.g., `@Resolver`, `@ResolveField`, `@Args`, etc.) are exported from the `@nestjs/graphql` package.
158159
159160
You can define multiple resolver classes. Nest will combine these at run time. See the [module](/graphql/resolvers#module) section below for more on code organization.
@@ -170,6 +171,8 @@ In our example, since the class includes a **field resolver** function (for the
170171

171172
We can define multiple `@Query()` resolver functions (both within this class, and in any other resolver class), and they will be aggregated into a single **Query type** definition in the generated SDL along with the appropriate entries in the resolver map. This allows you to define queries close to the models and services that they use, and to keep them well organized in modules.
172173

174+
> info **Hint** Nest CLI provides a generator (schematic) that automatically generates **all the boilerplate code** to help us avoid doing all of this, and make the developer experience much simpler. Read more about this feature [here](/recipes/crud-generator).
175+
173176
#### Query type names
174177

175178
In the above examples, the `@Query()` decorator generates a GraphQL schema query type name based on the method name. For example, consider the following construction from the example above:
@@ -560,6 +563,8 @@ export class AuthorsResolver {
560563
}
561564
```
562565

566+
> info **Hint** Nest CLI provides a generator (schematic) that automatically generates **all the boilerplate code** to help us avoid doing all of this, and make the developer experience much simpler. Read more about this feature [here](/recipes/crud-generator).
567+
563568
#### Generating types
564569

565570
Assuming that we use the schema first approach and have enabled the typings generation feature (with `outputAs: 'class'` as shown in the [previous](/graphql/quick-start) chapter), once you run the application it will generate the following file (in the location you specified in the `GraphQLModule.forRoot()` method. For example, in `src/graphql.ts`)

content/recipes/crud-generator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Following the best practices, for each entity we would have to perform several o
1515

1616
That's a lot of steps!
1717

18-
To help speed up this repetitive process, [NestJS CLI](https://docs.nestjs.com/cli/overview) provides a new generator (schematic) that automatically generates all the boilerplate code to help us avoid doing all of this, and make the developer experience much simpler.
18+
To help speed up this repetitive process, [Nest CLI](/cli/overview) provides a generator (schematic) that automatically generates all the boilerplate code to help us avoid doing all of this, and make the developer experience much simpler.
1919

2020
> info **Note** The schematic supports generating **HTTP** controllers, **Microservice** controllers, **GraphQL** resolvers (both code first and schema first), and **WebSocket** Gateways.
2121

0 commit comments

Comments
 (0)