diff --git a/Sources/Pioneer/GraphQL/GraphQLMiddleware.swift b/Sources/Pioneer/GraphQL/GraphQLMiddleware.swift index 57d63ff..3570619 100644 --- a/Sources/Pioneer/GraphQL/GraphQLMiddleware.swift +++ b/Sources/Pioneer/GraphQL/GraphQLMiddleware.swift @@ -31,14 +31,14 @@ public typealias GraphQLMiddleware = ( /// Build a single resolver with a single base resolver and a handful middlewares /// - Parameters: -/// - function: The base resolver +/// - function: The base resolver /// - middlewares: The middlewares to wrap the resolvers /// - Returns: A single resolver with middleware applied public func buildResolver( from function: @escaping SyncResolve, using middlewares: [GraphQLMiddleware] ) -> ConcurrentResolve { - { root in + { root in { ctx, args in let info = ResolverParameters(root: root, context: ctx, args: args) let result = middlewares @@ -50,19 +50,19 @@ public func buildResolver( } return try await result() } - } + } } /// Build a single resolver with a single base resolver and a handful middlewares /// - Parameters: -/// - function: The base async resolver +/// - function: The base async resolver /// - middlewares: The middlewares to wrap the resolvers /// - Returns: A single resolver with middleware applied public func buildResolver( from function: @escaping ConcurrentResolve, using middlewares: [GraphQLMiddleware] ) -> ConcurrentResolve { - { root in + { root in { ctx, args in let info = ResolverParameters(root: root, context: ctx, args: args) let result = middlewares @@ -74,5 +74,5 @@ public func buildResolver( } return try await result() } - } + } } diff --git a/Sources/Pioneer/GraphQL/GraphQLRequest.swift b/Sources/Pioneer/GraphQL/GraphQLRequest.swift index 58cc2aa..b43cd22 100644 --- a/Sources/Pioneer/GraphQL/GraphQLRequest.swift +++ b/Sources/Pioneer/GraphQL/GraphQLRequest.swift @@ -21,7 +21,7 @@ public struct GraphQLRequest: Codable, @unchecked Sendable { /// Variables seperated and assign to constant in the query public var variables: [String: Map]? /// Extensions for the request - public var extensions: [String: Map]? = nil + public var extensions: [String: Map]? /// Parsed GraphQL Document from request public var ast: Document? diff --git a/Sources/Pioneer/Vapor/Extensions/WebSocket/WebSocket+WebSocketable.swift b/Sources/Pioneer/Vapor/Extensions/WebSocket/WebSocket+WebSocketable.swift index 15a3cd8..c9a803a 100644 --- a/Sources/Pioneer/Vapor/Extensions/WebSocket/WebSocket+WebSocketable.swift +++ b/Sources/Pioneer/Vapor/Extensions/WebSocket/WebSocket+WebSocketable.swift @@ -14,6 +14,6 @@ extension WebSocket: WebSocketable { } public func terminate(code: WebSocketErrorCode) async throws { - try await close(code: code) + try await close(code: code).get() } }