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
+84Lines changed: 84 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -738,3 +738,87 @@ 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 currently 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 has no originating subgraph, so we don't need to extend `Query` anymore. For more detail please refer to [this topic](https://www.apollographql.com/docs/federation/federation-2/new-in-federation-2#entities) in Apollo docs.
753
+
754
+
#### Schema first
755
+
756
+
We can simply remove `extend` keyword from the schema.
0 commit comments