Hi,
I have a React text input like this:
<input
type="text"
id="input"
onBlur={event =>
submitMessage(event.target.value)
}
/>
This is inside a larger component which also queries data.
I would like to make a mutation with that submitMessage
handler, but I’m not clear on how to pass the event.target.value
into the mutation. So far I have:
const [submitMessage, { loading, error }] = useMutation(
MESSAGE_MUTATION,
{
variables: {
SendMessageInput: {
body: body
}
}
}
)
How would I use the value of the input to populate a variable to mutate that data?
Thanks
Ben