@apollographql/apollo-upload-server
Version:
Enhances Apollo GraphQL Server for intuitive file uploads via GraphQL mutations.
15 lines (12 loc) • 483 B
JavaScript
import { GraphQLScalarType } from 'graphql';
export const GraphQLUpload = new GraphQLScalarType({
name: 'Upload',
description: 'The `Upload` scalar type represents a file upload promise that resolves ' + 'an object containing `stream`, `filename`, `mimetype` and `encoding`.',
parseValue: value => value,
parseLiteral() {
throw new Error('Upload scalar literal unsupported');
},
serialize() {
throw new Error('Upload scalar serialization unsupported');
}
});