Skip to content

Commit 2bf46e6

Browse files
Merge pull request #2171 from Tony133/docs/update-graphql-federation
docs(graphql): added links for graphql federation examples
2 parents d62917e + c03e46c commit 2bf46e6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

content/graphql/federation.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ import { UsersService } from './users.service'; // Not included in this example
136136
export class AppModule {}
137137
```
138138

139+
#### Example
140+
141+
A working example is available [here](https://github.com/nestjs/nest/tree/master/sample/31-graphql-federation-code-first/users-application) in code first mode and [here](https://github.com/nestjs/nest/tree/master/sample/32-graphql-federation-schema-first/users-application) in schema first mode.
142+
139143
#### Federated example: Posts
140144

141145
Our Post service serves aggregated posts via a `getPosts` query, but also extends our `User` type with `user.posts`
@@ -318,6 +322,9 @@ import { PostsService } from './posts.service'; // Not included in example
318322
})
319323
export class AppModule {}
320324
```
325+
#### Example
326+
327+
A working example is available [here](https://github.com/nestjs/nest/tree/master/sample/31-graphql-federation-code-first/posts-application) for the code first mode and [here](https://github.com/nestjs/nest/tree/master/sample/32-graphql-federation-schema-first/posts-application) for the schema first mode.
321328

322329
#### Federated example: Gateway
323330

@@ -354,6 +361,10 @@ export class AppModule {}
354361

355362
> info **Hint** Apollo recommends that you don't rely on the service discovery in a production environment but use their [Graph Manager](https://www.apollographql.com/docs/graph-manager/federation/) instead.
356363
364+
#### Example
365+
366+
A working example is available [here](https://github.com/nestjs/nest/tree/master/sample/31-graphql-federation-code-first/gateway) for the code first mode and [here](https://github.com/nestjs/nest/tree/master/sample/32-graphql-federation-schema-first/gateway) for the schema first mode.
367+
357368
#### Sharing context
358369

359370
You can customize the requests between the gateway and federated services using a build service. This allows you to share context about the request. You can easily extend the default `RemoteGraphQLDataSource` and implement one of the hooks. Please refer to [Apollo Docs](https://www.apollographql.com/docs/apollo-server/api/apollo-gateway/#remotegraphqldatasource) on `RemoteGraphQLDataSource` for more information about the possibilities.

0 commit comments

Comments
 (0)