Closed jaredh159 closed 3 years ago
You know, I thought a bit more, and realized, I could just copy the inner code from your register function into my configure.swift
file and make the change of collect stream size there. So, there is a workaround. If this seems to fringe of a customization, maybe just close this, and I'll go that route.
Thanks for the PR.
I think you are right. Offering this option will enable more use cases.
I tested the change with the .stream
strategy and it seems to work so far.
What do you think about my proposal of the parameter naming?
Yup, I like your parameter name better. I was trying to follow how normal routes are named in vanilla Vapor, but I think postBody
was a little awkward. Updated the PR with new parameter name. 👍
Thanks for merging! When you have a minute, can you cut a new release for this change?
Thanks for the reminder. Please see release 2.3.1 (created just now).
hey Alex! 👋 me again.
I have a mutation for a bulk insert of many records at once, and I found I was running into Vapor's default streaming body collection size. I was able to fix it by overriding the collect stream size limit globally, but I'd really rather only do that for POST requests to the
/graphql
route, for obvious reasons.This PR adds an optional configuration setting for your
register()
function, allowing a custom strategy to be passed in for the POST handler.I struggled with the naming of the param a bit -- as I mentioned, I didn't want to apply it to GET requests, so I called it
postBody
. But if you can think of a better name, or if there's some other way to selectively customize this value without changing the library (maybe a middleware?), let me know. Thanks!