Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Sources/GraphQLWS/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class Server<InitPayload: Equatable & Codable> {
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

Expand Down Expand Up @@ -128,7 +128,7 @@ public class Server<InitPayload: Equatable & Codable> {

/// 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
}

Expand Down Expand Up @@ -283,7 +283,7 @@ public class Server<InitPayload: Equatable & Codable> {
id: id
).toJSON(encoder)
)
onOperationError(id)
onOperationError(id, errors)
}

/// Send an `error` response through the messenger
Expand Down