Closed pashak09 closed 1 year ago
Thank you for putting together a contribution :)
There are two reasons not to add a feature like this:
Upload
scalar, in the same way that it wouldn't make sense to have a server wide filter on the types of strings or numbers the String
or Int
scalars can accept. It is up to resolvers to validate the inputs they receive; ideally if your GraphQL schema grows to have a mutation that accepts different kinds of files than past mutations, you just need to add that new mutation with new validation rules in the resolver. You shouldn't have to reconfigure the server middleware.
This will most likely slow down the processing of the request, but will allow the to check the client sent file type.