gqlgen icon indicating copy to clipboard operation
gqlgen copied to clipboard

Override transport.MultipartForm UploadFileSize limit

Open bqiang-wish opened this issue 2 years ago • 4 comments

What happened?

handler.NewDefaultServer adds a default MultipartForm transport which limits the UploadFileSize to 32MB. If I would like to override this file size limit, I think I would do something like, according to https://github.com/99designs/gqlgen/blob/master/example/fileupload/server/server.go#L29

server := handler.NewDefaultServer(...)
server.AddTransport(transport.MultipartForm{
	MaxUploadSize: 100 << 20,
})

but I think this function will return the first transport.MultipartForm https://github.com/99designs/gqlgen/blob/master/graphql/handler/server.go#L87

So the file size limit is not overrided

What did you expect?

Should allow later transport overrides previous ones

Minimal graphql.schema and models to reproduce

versions

  • gqlgen version: v0.13.0
  • go version: go1.16.3
  • dep or go modules?

bqiang-wish avatar Sep 22 '21 19:09 bqiang-wish

Can copy code from NewDefaultServer and use NewServer instead. That's what I do to remove not wanted items and add or modify others

samlof avatar Sep 28 '21 08:09 samlof

Quite an annoying bug. Usually, you expect examples to be working and spend more time checking code elsewhere.

ubombi avatar Oct 13 '21 15:10 ubombi

Is this issue still not resolved yet ?

oSethoum avatar Mar 21 '22 07:03 oSethoum