@@ -30,8 +30,6 @@ public class Server {
3030 /// - messenger: The messenger to bind the server to.
3131 /// - onExecute: Callback run during `subscribe` resolution for non-streaming queries. Typically this is `API.execute`.
3232 /// - onSubscribe: Callback run during `subscribe` resolution for streaming queries. Typically this is `API.subscribe`.
33- /// - onExit: Callback run when the communication is shut down, either by the client or server
34- /// - onMessage: callback run on receipt of any message
3533 public init (
3634 messenger: Messenger ,
3735 onExecute: @escaping ( GraphQLRequest ) -> EventLoopFuture < GraphQLResult > ,
@@ -148,7 +146,7 @@ public class Server {
148146 guard let self = self else { return }
149147 guard let streamOpt = result. stream else {
150148 // API issue - subscribe resolver isn't stream
151- self . error ( . internalAPIStreamIssue ( errors: result . errors ) )
149+ self . sendError ( result . errors, id : id )
152150 return
153151 }
154152 let stream = streamOpt as! ObservableSubscriptionEventStream
@@ -171,12 +169,11 @@ public class Server {
171169 onCompleted: { [ weak self] in
172170 guard let self = self else { return }
173171 self . sendComplete ( id: id)
174- self . messenger? . close ( )
175172 }
176173 ) . disposed ( by: self . disposeBag)
177174 }
178175 subscribeFuture. whenFailure { error in
179- self . error ( . graphQLError ( error) )
176+ self . sendError ( error, id : id )
180177 }
181178 }
182179 else {
@@ -199,7 +196,6 @@ public class Server {
199196 self . error ( . notInitialized( ) )
200197 return
201198 }
202- onExit ( )
203199 }
204200
205201 /// Send a `connection_ack` response through the messenger
0 commit comments