You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/graphql/federation.md
+130-1Lines changed: 130 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ To quote the [Apollo docs](https://blog.apollographql.com/apollo-federation-f260
11
11
12
12
> warning **Warning** Federation currently does not support subscriptions.
13
13
14
-
In the following sections, we'll set up a demo application that consits of a gateway and two federated endpoints: Users service and Posts service.
14
+
In the following sections, we'll set up a demo application that consists of a gateway and two federated endpoints: Users service and Posts service.
15
15
16
16
#### Federation with Apollo
17
17
@@ -738,3 +738,132 @@ import { GraphQLModule } from '@nestjs/graphql';
738
738
})
739
739
exportclassAppModule {}
740
740
```
741
+
742
+
### Federation 2
743
+
744
+
To quote the [Apollo docs](https://www.apollographql.com/docs/federation/federation-2/new-in-federation-2), Federation 2 improves developer experience from the original Apollo Federation (called Federation 1 in this doc), which is backward compatible with most original supergraphs.
745
+
746
+
> warning **Warning** Mercurius doesn't fully support Federation 2. You can see the list of libraries that support Federation 2 [here](https://www.apollographql.com/docs/federation/supported-subgraphs#javascript--typescript).
747
+
748
+
In the following sections, we'll upgrade the previous example to Federation 2.
749
+
750
+
#### Federated example: Users
751
+
752
+
One change in Federation 2 is that entities have no originating subgraph, so we don't need to extend `Query` anymore. For more detail please refer to [the entities topic](https://www.apollographql.com/docs/federation/federation-2/new-in-federation-2#entities) in Apollo Federation 2 docs.
753
+
754
+
#### Schema first
755
+
756
+
We can simply remove `extend` keyword from the schema.
0 commit comments