Closed lewatt23 closed 2 years ago
Hello everyone, please i have an issue defining the upload type, i doing what the doc says i.e https://graphql-compose.github.io/docs/guide/file-uploads.html#2-adding-graphqlupload-scalar-type-to-graphql-compose, but it doesn't work. here's my code
const mediaUploadByFile = MediaTC.mongooseResolvers .createOne() .wrap((newResolver) => { newResolver.cloneArg("record", "UploadByFileMediaInput"); newResolver.getArgITC("record").addFields({ file: { type: "Upload", description: "Upload by file, pass the file as arg here.", }, }); return newResolver; }) .wrapResolve((next) => (rp) => { rp.beforeRecordMutate = async ( doc: IMedia, resolveParams: ResolverResolveParams< IMedia, any, { record: IMedia & { file: GQLFileUpload } } > ) => { const record = resolveParams.args.record; const file = await record.file; console.log("file", file); // return createFile(doc, file); }; return next(rp); });
Hello everyone, please i have an issue defining the upload type, i doing what the doc says i.e https://graphql-compose.github.io/docs/guide/file-uploads.html#2-adding-graphqlupload-scalar-type-to-graphql-compose, but it doesn't work. here's my code