Closed kanopa closed 1 month ago
Thanks for the reproduction but could you give instructions for the reproduction?
Thanks for the reproduction but could you give instructions for the reproduction?
Of course, i create repo with reproduction. Call mutation filesUpload with files as parameters, you can use any files for your choise :) Server starts on localhost:3000/graphql I prefer using altair gql client for test upload mutations
Describe the bug
I am working on a NestJS (fastify) project that uses a schema-first approach for GraphQL and I want to implement a file upload feature. For DTO validation, I am using class-validator in combination with class-transformer, and I am applying a global validation pipe via NestJS's ValidationPipe from the @nestjs/common module.
I am encountering an issue when handling file uploads. Specifically, I receive a TypeError: Cannot read properties of undefined (reading 'length') related to PonyfillBlob. This error occurs because class-transformer attempts to create an instance of the class and encounters undefined properties, which leads to this error.
To Reproduce Steps to reproduce the behavior:
I create a demo repository with problem https://github.com/kanopa/yoga-nests-upload-issue
Maybe its better to type blobParts as nullable (private blobParts?: BlobPart[]) and add nullable to condition on 51 line?