{"size": 739, "ext": "es6", "max_stars_repo_path": "Models/Slot/SlotMutationsQL.es6", "max_stars_repo_name": "marlon407/graph-wms", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Models/Slot/SlotMutationsQL.es6", "max_issues_repo_name": "marlon407/graph-wms", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "Models/Slot/SlotMutationsQL.es6", "max_forks_repo_name": "marlon407/graph-wms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 19.4473684211, "max_line_length": 59, "alphanum_fraction": 0.5710419486}
import {
  GraphQLObjectType,
  GraphQLSchema,
  GraphQLString,
  GraphQLInt,
  GraphQLNonNull,
  GraphQLList,
  GraphQLID
  } from 'graphql';

import SlotType from './SlotTypeQL.es6';
import Slot from './SlotSchema.es6';

export default {
  addSlot:{
    type:SlotType,
    args: {
      number:{
        name:'number',
        type:new GraphQLNonNull(GraphQLString)
      },
      width:{
        name:'width',
        type: new GraphQLNonNull(GraphQLInt)
      }
    },
    resolve: (root, {number, width}) => {
      var newSlot = new Slot({number:number, width:width});

      return new Promise((resolve, reject) => {
        newSlot.save((err, res) => {
          err ? reject(err): resolve(res);
        });
      });
    }
  }
};
