jaydenseric / graphql-upload

Middleware and a scalar Upload to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
https://npm.im/graphql-upload
MIT License
1.43k stars 132 forks source link

More properties in Upload resolver #112

Closed huv1k closed 6 years ago

huv1k commented 6 years ago

Hey, I wonder if there is some easy way to get more properties in Upload scalar promise, for example folder or something. So I can have for example uploadFile(folder: String!, file: Upload!): File and use it to store to different locations.

mike-marcacci commented 6 years ago

Hi @Huvik, you can already do this exactly! Awaiting the file argument doesn't have any effect on the folder argument. Perhaps I'm missing something though?

huv1k commented 6 years ago

@mike-marcacci Sorry for the question, but I figured it out by myself wrote the whole resolver. I was first trying to work with express middleware, but no luck.

mike-marcacci commented 6 years ago

No worries at all! Glad you got it solved :)