-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can I use mysql to save the message? #738
Comments
Yes you can use mysql to save messages. |
Hi, I add this question to readme/questions ;) |
how do you connect giftedChat to mysql |
thanks bro. Closed |
a graphql example would be awesome |
This has worked for me (you have to use withApollo HOC and use prop 'client'): ....
const onSend = (newMessages: IMessage[] = []) => {
newMessages.forEach(message => {
client
.mutate({
variables: {
...
},
mutation: YOUR_MUTATION,
})
.then(response => {
setMessagesHistory(prevMessages =>
GiftedChat.append(prevMessages, message)
)
})
.catch(error => {
// error logic
})
})
}
....
return (
<GiftedChat
messages={yourMessagesFromState}
onSend={messages => onSend(messages)}
.....
/>
) |
Issue Description
Can I use mysql to save the message?
Can I customize the message object? Compulsory use of your format?
The text was updated successfully, but these errors were encountered: