const {
  GraphQLObjectType,
  GraphQLNonNull,
  GraphQLString,
  GraphQLID,
  GraphQLInt,
  GraphQLInputObjectType,
  GraphQLBuffer,
} = require('graphql');
const { DateTime } = require('./CustomTypes');

exports.file = new GraphQLInputObjectType({
  name: 'File',
  description: 'A file uploaded via multipart/form-data',
  fields: () => ({
    fieldname: {
      type: new GraphQLNonNull(GraphQLString),
      description: 'The fieldname used to POST this file.',
    },
    originalname: {
      type: new GraphQLNonNull(GraphQLString),
      description: 'The original file name.',
    },
    buffer: {
      type: new GraphQLNonNull(GraphQLBuffer),
      description: 'The file buffered in memory',
    },
  }),
});

exports.outputType = new GraphQLObjectType({
  name: 'Asset',
  fields: {
    _id: {
      type: new GraphQLNonNull(GraphQLID),
      description: 'Mongo ID string.',
    },
    title: {
      type: new GraphQLNonNull(GraphQLString),
      description: 'Title of the asset.',
    },
    extension: {
      type: new GraphQLNonNull(GraphQLString),
      description: 'File extension of the asset.',
    },
    filename: {
      type: new GraphQLNonNull(GraphQLString),
      description: 'The original filename of the asset (in the local file system).',
    },
    dateCreated: {
      type: new GraphQLNonNull(DateTime),
    },
    width: {
      type: new GraphQLNonNull(GraphQLInt),
      description: 'The width, in pixels, of the asset.',
    },
    height: {
      type: new GraphQLNonNull(GraphQLInt),
      description: 'The height, in pixels, of the asset.',
    },
    size: {
      type: new GraphQLNonNull(GraphQLInt),
      description: 'The file size, in bytes, of the asset.',
    },
    mimetype: {
      type: new GraphQLNonNull(GraphQLString),
      description: 'The mimetype of the asset.',
    },
  },
});

exports.inputType = new GraphQLInputObjectType({
  name: 'AssetInput',
  fields: {
    title: {
      type: GraphQLString,
      description: 'Title of the asset.',
    },
    filename: {
      type: GraphQLString,
      description: 'The original filename of the asset (in the local file system).',
    },
    mimetype: {
      type: GraphQLString,
      description: 'The mimetype of the asset.',
    },
    size: {
      type: GraphQLInt,
      description: 'The file size, in bytes, of the asset.',
    },
    width: {
      type: GraphQLInt,
      description: 'The width, in pixels, of the asset.',
    },
    height: {
      type: GraphQLInt,
      description: 'The height, in pixels, of the asset.',
    },
  },
});

@@ -114,25 +114,8 @@
 pe,%0A
-  GraphQLBuffer,%0A
 %7D = 
@@ -186,525 +186,8 @@
 );%0A%0A
-exports.file = new GraphQLInputObjectType(%7B%0A  name: 'File',%0A  description: 'A file uploaded via multipart/form-data',%0A  fields: () =%3E (%7B%0A    fieldname: %7B%0A      type: new GraphQLNonNull(GraphQLString),%0A      description: 'The fieldname used to POST this file.',%0A    %7D,%0A    originalname: %7B%0A      type: new GraphQLNonNull(GraphQLString),%0A      description: 'The original file name.',%0A    %7D,%0A    buffer: %7B%0A      type: new GraphQLNonNull(GraphQLBuffer),%0A      description: 'The file buffered in memory',%0A    %7D,%0A  %7D),%0A%7D);%0A%0A
 expo

Delete unused code