Book Image

Building Vue.js Applications with GraphQL

By : Heitor Ramon Ribeiro
Book Image

Building Vue.js Applications with GraphQL

By: Heitor Ramon Ribeiro

Overview of this book

Since its release by Facebook in 2012, GraphQL has taken the internet by storm. Huge companies such as Airbnb and Audi have started to adopt it, while small to medium-sized companies are now recognizing the potential of this query-based API. GraphQL may seem strange at first, but as you start to read about and experience more of it, you won’t want to use REST APIs anymore. With the recipes in this book, you will learn how to build a complete real-time chat app from scratch. Starting by creating an AWS Amplify environment, you will delve into developing your first GraphQL Schema. You will then learn how to add the AppSync GraphQL client and create your first GraphQL mutation. The book also helps you to discover the simplicity and data fetching capabilities of GraphQL that make it easy for front-end developers to communicate with the server. You will later understand how to use Quasar Framework to create application components and layouts. Finally, you will find out how to create Vuex modules in your application to manage the app state, fetch data using the GraphQL client, and deploy your application to the web. By the end of this book, you’ll be well versed in proof-of-concept full-stack applications that explore the power of GraphQL with AWS Amplify, and you'll be able to use Quasar Framework to create your Vue applications.
Table of Contents (9 chapters)

What this book covers

Chapter 1, Data Binding, Form Validations, Events, and Computed Properties, discusses the basic Vue developments and component concepts, including v-model, event listeners, computed properties, and for loops. The reader will be introduced to the Vuelidate plugin for form validation and how to use it on a Vue component, along with how to debug a Vue component with vue-devtools.

Chapter 2, Components, Mixins, and Functional Components, walks the reader through building components with different approaches, including custom slots for contents, validated props, functional components, and creating mixins for code reusability. It then introduces the reader to a set of different approaches for accessing child components' data, creating a dependency injection component and dynamic injected component, and how to lazy load a component.

Chapter 3, Setting Up Our Chat App - AWS Amplify Environment and GraphQL, introduces the reader through the AWS Amplify CLI on how to create the Amplify environments. Creating their authentication gateway with AWS Cognito, an S3 File hosting bucket, and finally creating the GraphQL API. In this process, the reader will create the drivers to communicate between the frontend and backend.

Chapter 4, Creating Custom Application Components and Layouts, from now on the reader will start the development of the application. In this chapter, the reader will create the component that will be used in the creation of the pages of the chat application. The reader will create components like the PasswordInput, AvatarInput, EmailInput, and so on.

Chapter 5, Creating the User Vuex, Pages, and Routes, walks the reader through building the application's first Vuex module, which will be used to manage the User business rules and store the user data. Then the reader will create the user-related page for registration, editing, and validation. Finally, the reader will add the pages to the vue-router schema.

Chapter 6, Creating Chat and Message Vuex, Pages, and Routes, the reader will continue the creation of the Vuex modules of the application. Now it's time to create the Chat module. This module will contain the business rules for communication between users and store the chat data. Finally, the user will create the Chat-related page for conversation listing and the chat page, and then add it to the vue-router schema.

Chapter 7, Transforming your App into a PWA and Deploying to the Web, in this last chapter, the reader will finish the application by transforming it into a PWA application, adding the updates notifications and installation banner for iOS devices. Finally, the user will deploy the application to the web.