Closed vjpr closed 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
const mutation = new GraphQLObjectType({
name : 'Mutation',
fields : {
addClient : {
type : ClientType,
args : {
name : {type : GraphQLNonNull(GraphQLString)},
email : {type : GraphQLNonNull(GraphQLString)},
phone : {type : GraphQLNonNull(GraphQLString)}
},
async resolve(parent, args){
const clientObject = new client({
name : args.name,
email : args.email,
phone : args.phone
});
return await clientObject.save();
}
},
addProject : {
type : ProjectType,
args : {
clientId : {type : GraphQLNonNull(GraphQLID)},
name : {type : GraphQLNonNull(GraphQLString)},
description : {type : GraphQLNonNull(GraphQLString)},
status : {type : GraphQLNonNull(GraphQLString)}
},
async resolve(parent, args){
const projectObject = new project({
clientId : args.clientId,
name : args.name,
description : args.description,
status : args.status
});
return await project.save();
}
}
}
});
I have removed a single quote from'ClientType' from line no: 5. My previous code was type: 'ClientType'.
I have searched and spent 2 days on this error but did not get a proper solution.
Just Imagine just a single quote can hustle you hard!
It seems to only occur when I am using
JSONType
in a schema.