File tree Expand file tree Collapse file tree 3 files changed +1239
-2224
lines changed
example/federation/integration/gateway Expand file tree Collapse file tree 3 files changed +1239
-2224
lines changed Original file line number Diff line number Diff line change 1- const { ApolloServer } = require ( 'apollo-server' )
2- const { ApolloGateway, IntrospectAndCompose } = require ( '@apollo/gateway' ) ;
1+ import { ApolloServer } from '@apollo/server' ;
2+ import { startStandaloneServer } from '@apollo/server/standalone' ;
3+ import { ApolloGateway , IntrospectAndCompose } from '@apollo/gateway' ;
34
45const gateway = new ApolloGateway ( {
56 supergraphSdl : new IntrospectAndCompose ( {
@@ -12,9 +13,12 @@ const gateway = new ApolloGateway({
1213
1314const server = new ApolloServer ( {
1415 gateway,
15- subscriptions : false ,
16+ plugins : [
17+ ApolloServerPluginSubscription ( ) ,
18+ ] ,
1619} ) ;
1720
18- server . listen ( ) . then ( ( { url } ) => {
21+ ( async ( ) => {
22+ const { url } = await startStandaloneServer ( server ) ;
1923 console . log ( `Server ready at ${ url } ` ) ;
20- } ) ;
24+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments