@@ -13,7 +13,7 @@ import { execute, GraphQLSchema, subscribe } from 'graphql'
13
13
import { importSchema } from 'graphql-import'
14
14
import expressPlayground from 'graphql-playground-middleware-express'
15
15
import { makeExecutableSchema } from 'graphql-tools'
16
- import { createServer } from 'http'
16
+ import { createServer , Server } from 'http'
17
17
import * as path from 'path'
18
18
import { SubscriptionServer } from 'subscriptions-transport-ws'
19
19
@@ -39,8 +39,8 @@ export class GraphQLServer {
39
39
private middlewares : {
40
40
[ key : string ] : {
41
41
path ?: PathParams
42
- handlers : RequestHandler [ ] | RequestHandlerParams [ ] ,
43
- } [ ] ,
42
+ handlers : RequestHandler [ ] | RequestHandlerParams [ ]
43
+ } [ ]
44
44
} = { use : [ ] , get : [ ] , post : [ ] }
45
45
46
46
constructor ( props : Props ) {
@@ -101,12 +101,12 @@ export class GraphQLServer {
101
101
start (
102
102
options : Options ,
103
103
callback ?: ( ( options : Options ) => void ) ,
104
- ) : Promise < void >
105
- start ( callback ?: ( ( options : Options ) => void ) ) : Promise < void >
104
+ ) : Promise < Server >
105
+ start ( callback ?: ( ( options : Options ) => void ) ) : Promise < Server >
106
106
start (
107
107
optionsOrCallback ?: Options | ( ( options : Options ) => void ) ,
108
108
callback ?: ( ( options : Options ) => void ) ,
109
- ) : Promise < void > {
109
+ ) : Promise < Server > {
110
110
const options =
111
111
optionsOrCallback && typeof optionsOrCallback === 'function'
112
112
? { }
@@ -208,7 +208,10 @@ export class GraphQLServer {
208
208
209
209
if ( this . options . playground ) {
210
210
const playgroundOptions = this . options . subscriptions
211
- ? { endpoint : this . options . endpoint , subscriptionsEndpoint : this . options . subscriptions }
211
+ ? {
212
+ endpoint : this . options . endpoint ,
213
+ subscriptionsEndpoint : this . options . subscriptions ,
214
+ }
212
215
: { endpoint : this . options . endpoint }
213
216
214
217
app . get ( this . options . playground , expressPlayground ( playgroundOptions ) )
@@ -229,7 +232,7 @@ export class GraphQLServer {
229
232
230
233
combinedServer . listen ( this . options . port , ( ) => {
231
234
callbackFunc ( this . options )
232
- resolve ( )
235
+ resolve ( combinedServer )
233
236
} )
234
237
235
238
this . subscriptionServer = SubscriptionServer . create (
0 commit comments