express js file upload code example
Example 1: nexusjs file upload
t.field('updateProfilePic', { type: User, args: { pic: arg({ type: Upload, required: true }), }, resolve: async (root, args, context) => { const { createReadStream, mimetype, filename } = await args.pic.file // ... // ... },})
Example 2: nexusjs file upload
import { GraphQLUpload } from 'graphql-upload'export const Upload = asNexusMethod(GraphQLUpload, 'upload')