Skip to content

Commit

Permalink
Merge pull request #122 from d-exclaimation/chore-1
Browse files Browse the repository at this point in the history
chore: Format code
  • Loading branch information
d-exclaimation authored Jan 6, 2023
2 parents 1337b1f + dfbbff6 commit ce9245e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Sources/Pioneer/GraphQL/GraphQLMiddleware.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public typealias GraphQLMiddleware<Root, Context, Args, ResolveType> = (

/// 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<Root, Context, Args, ResolveType>(
from function: @escaping SyncResolve<Root, Context, Args, ResolveType>,
using middlewares: [GraphQLMiddleware<Root, Context, Args, ResolveType>]
) -> ConcurrentResolve<Root, Context, Args, ResolveType> {
{ root in
{ root in
{ ctx, args in
let info = ResolverParameters(root: root, context: ctx, args: args)
let result = middlewares
Expand All @@ -50,19 +50,19 @@ public func buildResolver<Root, Context, Args, ResolveType>(
}
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<Root, Context, Args, ResolveType>(
from function: @escaping ConcurrentResolve<Root, Context, Args, ResolveType>,
using middlewares: [GraphQLMiddleware<Root, Context, Args, ResolveType>]
) -> ConcurrentResolve<Root, Context, Args, ResolveType> {
{ root in
{ root in
{ ctx, args in
let info = ResolverParameters(root: root, context: ctx, args: args)
let result = middlewares
Expand All @@ -74,5 +74,5 @@ public func buildResolver<Root, Context, Args, ResolveType>(
}
return try await result()
}
}
}
}
2 changes: 1 addition & 1 deletion Sources/Pioneer/GraphQL/GraphQLRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}

0 comments on commit ce9245e

Please sign in to comment.