Materialize correctly set uup

This commit is contained in:
Luis Fernando Molina committed 2018-09-05 09:39:02 +02:00
1 parent 7f87c4d387
commit b6cbd26b79
7 files changed
+79 -47

No files matched your search

+3
View File
@@ -5,6 +5,9 @@ const userSchema = new Schema({
alias: String,
firstName:String,
lastName: String,
isDeveloper: Boolean,
isTrader: Boolean,
isDataAnalyst: Boolean,
roleId: String
})
+9
View File
@@ -27,6 +27,9 @@ const UserType = new GraphQLObjectType({
alias: {type: GraphQLString},
firstName: {type: GraphQLString},
lastName: {type: GraphQLString},
isDeveloper: {type: GraphQLString},
isTrader: {type: GraphQLString},
isDataAnalyst: {type: GraphQLString},
roleId: {type: GraphQLString},
role: {
type: RoleType,
@@ -98,6 +101,9 @@ const Mutation = new GraphQLObjectType({
alias: {type: new GraphQLNonNull(GraphQLString)},
firstName: {type: GraphQLString},
lastName: {type: GraphQLString},
isDeveloper: {type: GraphQLInt},
isTrader: {type: GraphQLInt},
isDataAnalyst: {type: GraphQLInt},
roleId: {type: new GraphQLNonNull(GraphQLString)}
},
resolve(parent, args) {
@@ -106,6 +112,9 @@ const Mutation = new GraphQLObjectType({
alias: args.alias,
firstName: args.firstName,
lastName: args.lastName,
isDeveloper: args.isDeveloper,
isTrader: args.isTrader,
isDataAnalyst: args.isDataAnalyst,
roleId: args.roleId
});
return user.save();