Skip to content

Commit

Permalink
Merge pull request #658 from graph-gophers/update-federation-example
Browse files Browse the repository at this point in the history
update federation example
  • Loading branch information
pavelnikolov authored Feb 22, 2025
2 parents b7dc4b1 + c8f6c44 commit 92eac66
Show file tree
Hide file tree
Showing 3 changed files with 1,239 additions and 2,224 deletions.
14 changes: 9 additions & 5 deletions example/federation/integration/gateway/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { ApolloServer } = require('apollo-server')
const { ApolloGateway, IntrospectAndCompose } = require('@apollo/gateway');
import { ApolloServer } from '@apollo/server';
import { startStandaloneServer } from '@apollo/server/standalone';
import { ApolloGateway, IntrospectAndCompose } from '@apollo/gateway';

const gateway = new ApolloGateway({
supergraphSdl: new IntrospectAndCompose({
Expand All @@ -12,9 +13,12 @@ const gateway = new ApolloGateway({

const server = new ApolloServer({
gateway,
subscriptions: false,
plugins: [
ApolloServerPluginSubscription(),
],
});

server.listen().then(({ url }) => {
(async () => {
const { url } = await startStandaloneServer(server);
console.log(`Server ready at ${url}`);
});
})();
Loading

0 comments on commit 92eac66

Please sign in to comment.