fastify-gql-upload
install
npm i fastify-gql-upload
usage
Plugin options should conform to https://github.com/jaydenseric/graphql-upload#type-processrequestoptions
fastify
example
const GQL = const GraphQLUpload = const fs = const util = const stream = const path = const pipeline = utilconst uploadsDir = path const schema = /* GraphQL */ ` scalar Upload type Query { add(x: Int, y: Int): Int } type Mutation { uploadImage(image: Upload): Boolean }` const resolvers = Upload: GraphQLUpload Query: add: async { return x + y } Mutation: uploadImage: async { const filename createReadStream = await image const rs = const ws = fs await return true } module { fastify fastify }