Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { graphqlUploadKoa } from 'graphql-upload'
import { GraphQLServiceContext } from '../typings'
const graphqlUpload = graphqlUploadKoa({
maxFieldSize: 1e6, // size in Bytes
maxFileSize: 4 * 1e6, // size in Bytes
maxFiles: 10,
})
function graphqlUploadKoaMiddleware(
ctx: GraphQLServiceContext,
next: () => Promise
): Promise {
return graphqlUpload(ctx as any, next)
}
export const upload = graphqlUploadKoaMiddleware
import { graphqlUploadKoa } from 'graphql-upload'
import { GraphQLServiceContext } from '../typings'
declare module 'graphql-upload' {
export function graphqlUploadKoa(options: ApolloUploadOptions): (ctx: GraphQLServiceContext, next: () => Promise) => Promise
}
export const upload = graphqlUploadKoa({
maxFieldSize: 1e6, // size in Bytes
maxFileSize: 4 * 1e6, // size in Bytes
maxFiles: 5,
})