Skip to content

Commit c0cc82e

Browse files
Merge pull request #9 from jaredh159/body-stream-strategy
allow customization of POST stream strategy
2 parents 0ecbc8e + 92ffc6a commit c0cc82e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/GraphQLKit/Graphiti+Router.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import Graphiti
33
import GraphQL
44

55
extension RoutesBuilder {
6-
public func register<RootType>(graphQLSchema schema: Schema<RootType, Request>, withResolver rootAPI: RootType, at path: PathComponent="graphql") {
7-
self.post(path) { (request) -> EventLoopFuture<Response> in
6+
public func register<RootType>(graphQLSchema schema: Schema<RootType, Request>, withResolver rootAPI: RootType, at path: PathComponent="graphql", postBodyStreamStrategy: HTTPBodyStreamStrategy = .collect) {
7+
self.on(.POST, path, body: postBodyStreamStrategy) { (request) -> EventLoopFuture<Response> in
88
try request.resolveByBody(graphQLSchema: schema, with: rootAPI)
99
.flatMap({
1010
$0.encodeResponse(status: .ok, for: request)

0 commit comments

Comments
 (0)