diff --git a/Sources/GraphQLWS/Server.swift b/Sources/GraphQLWS/Server.swift index 5f7ecc2..2af4bff 100644 --- a/Sources/GraphQLWS/Server.swift +++ b/Sources/GraphQLWS/Server.swift @@ -18,7 +18,7 @@ public class Server { var onExit: () -> Void = { } var onMessage: (String) -> Void = { _ in } var onOperationComplete: (String) -> Void = { _ in } - var onOperationError: (String) -> Void = { _ in } + var onOperationError: (String, [Error]) -> Void = { _, _ in } var initialized = false @@ -128,7 +128,7 @@ public class Server { /// Define the callback to run on error of any full operation (failed query, interrupted subscription) /// - Parameter callback: The callback to assign - public func onOperationError(_ callback: @escaping (String) -> Void) { + public func onOperationError(_ callback: @escaping (String, [Error]) -> Void) { self.onOperationError = callback } @@ -283,7 +283,7 @@ public class Server { id: id ).toJSON(encoder) ) - onOperationError(id) + onOperationError(id, errors) } /// Send an `error` response through the messenger