0

I want to use graphql upload package in nestjs. But I am facing some error-

Here is my code-

import { GraphqlUpload, FileUpload } from "graphql-upload/GraphQLUpload.mjs";
import { createWriteStream } from 'fs';

    @Mutation(() => SuccessInfo, { name: "updateProfile" })
    update(
        @Args("file", { type: () => GraphqlUpload }) {
            createReadStream,
            filename
        }: FileUpload
    ) {
        console.log(filename);
    }

enter image description here

How can I solve this.

Md Ali
  • 217
  • 1
  • 2
  • 10
  • 1
    why ware you importing the ESM version? (ie, `.mjs`). If you're using CJS but want to load a ESM-only package, read this: https://nodejs.org/api/esm.html#import-expressions – Micael Levi Dec 25 '22 at 21:27

0 Answers0