To create a chat application, we need to create custom business rules for the chat part of the application. This part will hold all the logic between fetching new messages, sending messages, and starting new conversations between users.
In this recipe, we will create the Chat module in the application Vuex, where we will store all the messages between the logged user and other users, fetch new messages, send new messages, and start new conversations.
Getting ready
The prerequisites for this recipe are as follows:
- The project from the previous recipe
- Node.js 12+
The Node.js global objects that are required are as follows:
- @aws-amplify/cli
- @quasar/cli
To start our Chat Vuex module, we will continue with the project that was created in the Creating GraphQL queries and fragments recipe.
How to do it...
For the creation of the Chat Vuex module, we will split our tasks into five parts: creating the state, mutations, getters, and actions...