Skip to content

Commit bd61991

Browse files
Merge pull request #3443 from emmayusufu/docs-fix-code-example-typos
docs: fix typos and incorrect identifiers in code examples
2 parents a9401fa + 144e421 commit bd61991

10 files changed

Lines changed: 22 additions & 22 deletions

File tree

content/devtools/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class AppModule {}
4040

4141
> warning **Warning** The reason we are checking the `NODE_ENV` environment variable here is that you should never use this module in production!
4242
43-
Once the `DevtoolsModule` is imported and your application is up and running (`npm run start:dev`), you should be able to navigate to [Devtools](https://devtools.nestjs.com) URL and see the instrospected graph.
43+
Once the `DevtoolsModule` is imported and your application is up and running (`npm run start:dev`), you should be able to navigate to [Devtools](https://devtools.nestjs.com) URL and see the introspected graph.
4444

4545
<figure><img src="/assets/devtools/modules-graph.png" /></figure>
4646

content/faq/request-lifecycle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class CatsController {
2626

2727
`Guard1` will execute before `Guard2` and both will execute before `Guard3`.
2828

29-
> info **Hint** When speaking about globally bound vs controller or locally bound, the difference is where the guard (or other component is bound). If you are using `app.useGlobalGuard()` or providing the component via a module, it is globally bound. Otherwise, it is bound to a controller if the decorator precedes a controller class, or to a route if the decorator precedes a route declaration.
29+
> info **Hint** When speaking about globally bound vs controller or locally bound, the difference is where the guard (or other component is bound). If you are using `app.useGlobalGuards()` or providing the component via a module, it is globally bound. Otherwise, it is bound to a controller if the decorator precedes a controller class, or to a route if the decorator precedes a route declaration.
3030
3131
#### Interceptors
3232

content/graphql/federation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ import { PostsResolver } from './posts.resolver';
214214
typePaths: ['**/*.graphql'],
215215
}),
216216
],
217-
providers: [PostsResolvers],
217+
providers: [PostsResolver],
218218
})
219219
export class AppModule {}
220220
```
@@ -320,8 +320,8 @@ import {
320320
} from '@nestjs/apollo';
321321
import { Module } from '@nestjs/common';
322322
import { User } from './user.entity';
323-
import { PostsResolvers } from './posts.resolvers';
324-
import { UsersResolvers } from './users.resolvers';
323+
import { PostsResolver } from './posts.resolvers';
324+
import { UsersResolver } from './users.resolvers';
325325
import { PostsService } from './posts.service'; // Not included in example
326326

327327
@Module({
@@ -585,7 +585,7 @@ import { PostsResolver } from './posts.resolver';
585585
typePaths: ['**/*.graphql'],
586586
}),
587587
],
588-
providers: [PostsResolvers],
588+
providers: [PostsResolver],
589589
})
590590
export class AppModule {}
591591
```
@@ -691,8 +691,8 @@ import {
691691
} from '@nestjs/mercurius';
692692
import { Module } from '@nestjs/common';
693693
import { User } from './user.entity';
694-
import { PostsResolvers } from './posts.resolvers';
695-
import { UsersResolvers } from './users.resolvers';
694+
import { PostsResolver } from './posts.resolvers';
695+
import { UsersResolver } from './users.resolvers';
696696
import { PostsService } from './posts.service'; // Not included in example
697697

698698
@Module({
@@ -847,8 +847,8 @@ import {
847847
} from '@nestjs/apollo';
848848
import { Module } from '@nestjs/common';
849849
import { User } from './user.entity';
850-
import { PostsResolvers } from './posts.resolvers';
851-
import { UsersResolvers } from './users.resolvers';
850+
import { PostsResolver } from './posts.resolvers';
851+
import { UsersResolver } from './users.resolvers';
852852
import { PostsService } from './posts.service'; // Not included in example
853853

854854
@Module({

content/graphql/schema-generator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ The `gqlSchemaFactory.create()` method takes an array of resolver class referenc
2525
const schema = await gqlSchemaFactory.create([
2626
RecipesResolver,
2727
AuthorsResolver,
28-
PostsResolvers,
28+
PostsResolver,
2929
]);
3030
```
3131

3232
It also takes a second optional argument with an array of scalar classes:
3333

3434
```typescript
3535
const schema = await gqlSchemaFactory.create(
36-
[RecipesResolver, AuthorsResolver, PostsResolvers],
36+
[RecipesResolver, AuthorsResolver, PostsResolver],
3737
[DurationScalar, DateScalar],
3838
);
3939
```

content/microservices/custom-transport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ If you need to add some custom logic around the serialization of responses on th
269269

270270
```typescript
271271
@@filename(error-handling.proxy)
272-
import { ClientTcp, RpcException } from '@nestjs/microservices';
272+
import { ClientTCP, RpcException } from '@nestjs/microservices';
273273

274274
class ErrorHandlingProxy extends ClientTCP {
275275
serializeError(err: Error) {

content/migration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ bootstrap();
9595
By default, only [CORS-safelisted methods](https://fetch.spec.whatwg.org/#methods) are allowed. If you need to enable additional methods (such as `PUT`, `PATCH`, or `DELETE`), you must explicitly define them in the `methods` option.
9696

9797
```typescript
98-
const methods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']; // OR comma-delimited string 'GET,POST,PUT,PATH,DELETE'
98+
const methods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']; // OR comma-delimited string 'GET,POST,PUT,PATCH,DELETE'
9999

100100
const app = await NestFactory.create<NestFastifyApplication>(
101101
AppModule,

content/recipes/mongodb.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export const CatSchema = new mongoose.Schema({
6969
});
7070
```
7171

72-
The `CatsSchema` belongs to the `cats` directory. This directory represents the `CatsModule`.
72+
The `CatSchema` belongs to the `cats` directory. This directory represents the `CatsModule`.
7373

7474
Now it's time to create a **Model** provider:
7575

content/recipes/nest-commander.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ By default, Nest's logger is disabled when using the `CommandFactory`. It's poss
3838
```ts
3939
import { CommandFactory } from 'nest-commander';
4040
import { AppModule } from './app.module';
41-
import { LogService } './log.service';
41+
import { LogService } from './log.service';
4242

4343
async function bootstrap() {
4444
await CommandFactory.run(AppModule, new LogService());

content/security/rate-limiting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ The following options are valid for the object passed to the array of the `Throt
258258
</tr>
259259
<tr>
260260
<td><code>skipIf</code></td>
261-
<td>a function that takes in the <code>ExecutionContext</code> and returns a <code>boolean</code> to short circuit the throttler logic. Like <code>@SkipThrottler()</code>, but based on the request</td>
261+
<td>a function that takes in the <code>ExecutionContext</code> and returns a <code>boolean</code> to short circuit the throttler logic. Like <code>@SkipThrottle()</code>, but based on the request</td>
262262
</tr>
263263
</table>
264264

@@ -275,7 +275,7 @@ If you need to set up storage instead, or want to use some of the above options
275275
</tr>
276276
<tr>
277277
<td><code>skipIf</code></td>
278-
<td>a function that takes in the <code>ExecutionContext</code> and returns a <code>boolean</code> to short circuit the throttler logic. Like <code>@SkipThrottler()</code>, but based on the request</td>
278+
<td>a function that takes in the <code>ExecutionContext</code> and returns a <code>boolean</code> to short circuit the throttler logic. Like <code>@SkipThrottle()</code>, but based on the request</td>
279279
</tr>
280280
<tr>
281281
<td><code>throttlers</code></td>

content/techniques/mongo.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ Middleware (also called pre and post hooks) are functions which are passed contr
327327
{
328328
name: Cat.name,
329329
useFactory: () => {
330-
const schema = CatsSchema;
330+
const schema = CatSchema;
331331
schema.pre('save', function () {
332332
console.log('Hello from pre save');
333333
});
@@ -350,7 +350,7 @@ Like other [factory providers](https://docs.nestjs.com/fundamentals/custom-provi
350350
name: Cat.name,
351351
imports: [ConfigModule],
352352
useFactory: (configService: ConfigService) => {
353-
const schema = CatsSchema;
353+
const schema = CatSchema;
354354
schema.pre('save', function() {
355355
console.log(
356356
`${configService.get('APP_NAME')}: Hello from pre save`,
@@ -377,7 +377,7 @@ To register a [plugin](https://mongoosejs.com/docs/plugins.html) for a given sch
377377
{
378378
name: Cat.name,
379379
useFactory: () => {
380-
const schema = CatsSchema;
380+
const schema = CatSchema;
381381
schema.plugin(require('mongoose-autopopulate'));
382382
return schema;
383383
},
@@ -435,7 +435,7 @@ export const EventSchema = SchemaFactory.createForClass(Event);
435435
> info **Hint** The way mongoose tells the difference between the different discriminator models is by the "discriminator key", which is `__t` by default. Mongoose adds a String path called `__t` to your schemas that it uses to track which discriminator this document is an instance of.
436436
> You may also use the `discriminatorKey` option to define the path for discrimination.
437437
438-
`SignedUpEvent` and `ClickedLinkEvent` instances will be stored in the same collection as generic events.
438+
`SignUpEvent` and `ClickedLinkEvent` instances will be stored in the same collection as generic events.
439439

440440
Now, let's define the `ClickedLinkEvent` class, as follows:
441441

0 commit comments

Comments
 (0)