Skip to content

Commit

Permalink
Federation: Update docs to use IntrospectAndCompose (99designs#3077)
Browse files Browse the repository at this point in the history
`serviceList` now gets a deprecation warning to use IntrospectAndCompose
instead. We update our docs to avoid referring to deprecated services
  • Loading branch information
frankywahl authored May 16, 2024
1 parent de31828 commit e61a720
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions docs/content/recipes/federation.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ npm install --save @apollo/gateway apollo-server graphql

```typescript
const { ApolloServer } = require('apollo-server');
const { ApolloGateway } = require("@apollo/gateway");
const { ApolloGateway, IntrospectAndCompose } = require("@apollo/gateway");
const gateway = new ApolloGateway({
serviceList: [
{ name: 'accounts', url: 'http://localhost:4001/query' },
{ name: 'products', url: 'http://localhost:4002/query' },
{ name: 'reviews', url: 'http://localhost:4003/query' }
],
supergraphSdl: new IntrospectAndCompose({
subgraphs: [
{ name: 'accounts', url: 'http://localhost:4001/query' },
{ name: 'products', url: 'http://localhost:4002/query' },
{ name: 'reviews', url: 'http://localhost:4003/query' }
]
})
});
const server = new ApolloServer({
Expand Down

0 comments on commit e61a720

Please sign in to comment.