type here
i use
import GraphQLUpload from 'graphql-upload/GraphQLUpload.mjs'; import FileUpload from 'graphql-upload/GraphQLUpload.mjs';
for
@Mutation(() => String) async uploadFile( @Args('file', { type: () => GraphQLUpload }) file: typeof FileUpload, ): Promise<string> { console.log('Uploaded file:', file); return file.name; }
but
backend-1 | const GraphQLUpload_mjs_1 = require("graphql-upload/GraphQLUpload.mjs"); backend-1 | ^ backend-1 | Error [ERR_REQUIRE_ESM]: require() of ES Module /ProjectJ-Backend/node_modules/graphql-upload/GraphQLUpload.mjs not supported. backend-1 | Instead change the require of /ProjectJ-Backend/node_modules/graphql-upload/GraphQLUpload.mjs to a dynamic import() which is available in all CommonJS modules. backend-1 | at Object.<anonymous> (/ProjectJ-Backend/dist/apis/boards/boards.resolver.js:26:29)
PLZ help me..
i use
import GraphQLUpload from 'graphql-upload/GraphQLUpload.mjs'; import FileUpload from 'graphql-upload/GraphQLUpload.mjs';
for
@Mutation(() => String) async uploadFile( @Args('file', { type: () => GraphQLUpload }) file: typeof FileUpload, ): Promise<string> { console.log('Uploaded file:', file); return file.name; }
user24998355 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.