Skip to content

Commit 9a7c82a

Browse files
tuxmachinejohnbiundo
authored andcommitted
docs: apply suggestions from code review
Co-authored-by: John Biundo <[email protected]>
1 parent 821c4f0 commit 9a7c82a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

content/graphql/federation.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class AppModule {}
7878

7979
##### Code first
8080

81-
The code-first Federation is very similar to a regular code-first GraphQL. We simply add some extra decorators to the User entity.
81+
Code first federation is very similar to regular code first GraphQL. We simply add some extra decorators to the `User` entity.
8282

8383
```ts
8484
import { Directive, Field, ID, ObjectType } from '@nestjs/graphql';
@@ -98,7 +98,7 @@ export class User {
9898
}
9999
```
100100

101-
Our resolver has one extra method: `resolveReference`. It's called by the Apollo Gateway whenever a related resource requires a User instance. We'll see an example of this in the Posts service later on. Please note the `@ResolveReference` decorator.
101+
Our resolver has one extra method: `resolveReference`. It's called by the Apollo Gateway whenever a related resource requires a `User` instance. We'll see an example of this in the Posts service later on. Please note the `@ResolveReference` decorator.
102102

103103
```ts
104104
import { Args, Query, Resolver, ResolveReference } from '@nestjs/graphql';
@@ -141,7 +141,7 @@ export class AppModule {}
141141

142142
#### Federated example: Posts
143143

144-
Our Post microservice serves aggregated posts via a `getPosts` query, but also extends our User type with `user.posts`
144+
Our Post service serves aggregated posts via a `getPosts` query, but also extends our `User` type with `user.posts`
145145

146146
##### Schema first
147147

@@ -208,7 +208,7 @@ export class AppModule {}
208208

209209
##### Code first
210210

211-
We will need to create a class representing our User entity. Even though it lives in another microservice, we will be using and extending it. Note the `@extends` and `@external` directives
211+
We will need to create a class representing our `User` entity. Even though it lives in another service, we will be using and extending it. Note the `@extends` and `@external` directives.
212212

213213
```ts
214214
import { Directive, Field, ID, ObjectType } from '@nestjs/graphql';
@@ -231,7 +231,7 @@ export class User {
231231
}
232232
```
233233

234-
We create the resolver for our extension on the User entity as follows:
234+
We create the resolver for our extension on the `User` entity as follows:
235235

236236
```ts
237237
import { Parent, ResolveField, Resolver } from '@nestjs/graphql';
@@ -250,7 +250,7 @@ export class UserResolver {
250250
}
251251
```
252252

253-
We also need to create our Post entity
253+
We also need to create our `Post` entity:
254254

255255
```ts
256256
import { Directive, Field, ID, Int, ObjectType } from '@nestjs/graphql';
@@ -277,7 +277,7 @@ export class Post {
277277
}
278278
```
279279

280-
And its resolver
280+
And its resolver:
281281

282282
```ts
283283
import { Query, Args, ResolveReference, Resolver } from '@nestjs/graphql';
@@ -306,7 +306,7 @@ export class PostResolver {
306306
}
307307
```
308308

309-
And finally tie it together in a module. Note the schema build options, where we specify that User is an outside type.
309+
And finally tie it together in a module. Note the schema build options, where we specify that `User` is an outside type.
310310

311311
```ts
312312
import { Module } from '@nestjs/common';

0 commit comments

Comments
 (0)