diff --git a/Sources/GraphQLKit/Graphiti+Router.swift b/Sources/GraphQLKit/Graphiti+Router.swift index 4e1724f..46dbb33 100644 --- a/Sources/GraphQLKit/Graphiti+Router.swift +++ b/Sources/GraphQLKit/Graphiti+Router.swift @@ -3,8 +3,8 @@ import Graphiti import GraphQL extension RoutesBuilder { - public func register(graphQLSchema schema: Schema, withResolver rootAPI: RootType, at path: PathComponent="graphql") { - self.post(path) { (request) -> EventLoopFuture in + public func register(graphQLSchema schema: Schema, withResolver rootAPI: RootType, at path: PathComponent="graphql", postBodyStreamStrategy: HTTPBodyStreamStrategy = .collect) { + self.on(.POST, path, body: postBodyStreamStrategy) { (request) -> EventLoopFuture in try request.resolveByBody(graphQLSchema: schema, with: rootAPI) .flatMap({ $0.encodeResponse(status: .ok, for: request)