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

Ensure GraphQLUpload scalar errors when parsing invalid values #181

Closed jaydenseric closed 4 years ago

jaydenseric commented 4 years ago

This PR ensures the GraphQLUpload scalar errors when parsing invalid values.

The processRequest function now places references to instances of the now exported and documented Upload class in the GraphQL operation for the GraphQLUpload scalar to derive its value, and the GraphQLUpload scalar now throws a GraphQLError when it parses an invalid value.

Fixes https://github.com/jaydenseric/graphql-upload/issues/175.