Skip to content

Commit

Permalink
Merge pull request #9 from jaredh159/body-stream-strategy
Browse files Browse the repository at this point in the history
allow customization of POST stream strategy
  • Loading branch information
alexsteinerde authored Aug 20, 2021
2 parents 0ecbc8e + 92ffc6a commit c0cc82e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/GraphQLKit/Graphiti+Router.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Graphiti
import GraphQL

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

0 comments on commit c0cc82e

Please sign in to comment.