File tree 3 files changed +1239
-2224
lines changed
example/federation/integration/gateway
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' ;
3
4
4
5
const gateway = new ApolloGateway ( {
5
6
supergraphSdl : new IntrospectAndCompose ( {
@@ -12,9 +13,12 @@ const gateway = new ApolloGateway({
12
13
13
14
const server = new ApolloServer ( {
14
15
gateway,
15
- subscriptions : false ,
16
+ plugins : [
17
+ ApolloServerPluginSubscription ( ) ,
18
+ ] ,
16
19
} ) ;
17
20
18
- server . listen ( ) . then ( ( { url } ) => {
21
+ ( async ( ) => {
22
+ const { url } = await startStandaloneServer ( server ) ;
19
23
console . log ( `Server ready at ${ url } ` ) ;
20
- } ) ;
24
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments