@@ -30,8 +30,6 @@ public class Server {
30
30
/// - messenger: The messenger to bind the server to.
31
31
/// - onExecute: Callback run during `subscribe` resolution for non-streaming queries. Typically this is `API.execute`.
32
32
/// - 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
35
33
public init (
36
34
messenger: Messenger ,
37
35
onExecute: @escaping ( GraphQLRequest ) -> EventLoopFuture < GraphQLResult > ,
@@ -148,7 +146,7 @@ public class Server {
148
146
guard let self = self else { return }
149
147
guard let streamOpt = result. stream else {
150
148
// API issue - subscribe resolver isn't stream
151
- self . error ( . internalAPIStreamIssue ( errors: result . errors ) )
149
+ self . sendError ( result . errors, id : id )
152
150
return
153
151
}
154
152
let stream = streamOpt as! ObservableSubscriptionEventStream
@@ -171,12 +169,11 @@ public class Server {
171
169
onCompleted: { [ weak self] in
172
170
guard let self = self else { return }
173
171
self . sendComplete ( id: id)
174
- self . messenger? . close ( )
175
172
}
176
173
) . disposed ( by: self . disposeBag)
177
174
}
178
175
subscribeFuture. whenFailure { error in
179
- self . error ( . graphQLError ( error) )
176
+ self . sendError ( error, id : id )
180
177
}
181
178
}
182
179
else {
@@ -199,7 +196,6 @@ public class Server {
199
196
self . error ( . notInitialized( ) )
200
197
return
201
198
}
202
- onExit ( )
203
199
}
204
200
205
201
/// Send a `connection_ack` response through the messenger
0 commit comments