Skip to content

Commit

Permalink
allow customization of POST stream strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredh159 committed Aug 16, 2021
1 parent 0ecbc8e commit 92ffc6a
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 92ffc6a

Please sign in to comment.