I have the following input object type that I want to validate its field by set required. e.g: I want to set name and phone1 property as required. I would like to know is there is any way that we can do it. I have searched on the internet so far there is no answer. I am really appreciated for anyone kind help.
const input = new GraphQLInputObjectType({
name: "UserCustomerAddressInput",
fields: () => {
id: { type: GraphQLInt },
name: { type: GraphQLString },
homeNumber: { type: GraphQLString },
phone1: { type: GraphQLString },
phone2: { type: GraphQLString },
location: { type: GraphQLString },
isPrimary: { type: GraphQLBoolean }
},
});