Need help figuring this out.
Assistly youtube project
Mutation for the ADD_CHARACTERISTIC is not populating the db with the mutation all the code is correct I think I'm missing something here?
JS:
const handleAddCharacteristic = async (content: string) => {
try {
const promise = addCharacteristic({
variables: {
chatbotId: Number(id),
content,
},
});
toast.promise(promise, {
loading: "Adding...",
success: "Information added",
error: "Failed to add Information",
})
} catch (error) {
console.error("Failed to add characteristic", error)
}
}
Mutation:
export const ADD_CHARACTERISTIC = gql`
mutation AddCharacteristic($chatbotId: Int!, $content: String!) {
insertChatbot_characteristics(chatbot_id: $chatbotId, content: $content) {
id
content
created_at
}
}
`;
Am I missing something here?