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)

To get the most out of this book

This book uses Vue.js 2.7 from Chapter 2, Components, Mixins, and Functional Components, onwards, as it is the latest support version for Quasar Framework at the time of writing. This book will have code in Vue.js 3 up to Chapter 3, Setting Up Our Chat App - AWS Amplify Environment and GraphQL . All code will be updated with the final release on the GitHub repository here: https://github.com/PacktPublishing/Building-Vue.js-Applications-with-GraphQL

You will need Node.js 12+ installed, Vue CLI updated to the latest version, and a good code editor of some sort. Other requirements will be introduced in each recipe. All the software requirements are available for Windows, macOS, and Linux.

Here's a table summarizing all the requirements:

Chapter Number

Software/hardware covered in the book

Download Links

OS requirements

1 to 7

Vue CLI 4.X

https://cli.vuejs.org/

Windows / Linux / macOS

3 to 7

Quasar-CLI 1.X

https://quasar.dev/

Windows / Linux / macOS

3 to 7

Visual Studio Code 1.4.X and IntelliJ WebStorm 2020.2

https://code.visualstudio.com/ Windows / Linux / macOS

3 to 7

AWS Amplify CLI 3.3.X

https://aws.amazon.com/appsync/resources/ Windows / Linux / macOS

1 to 7

Node.js 12+-

https://nodejs.org/en/download/ Windows / Linux / macOS

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Building-Vue.js-Applications-with-GraphQL. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "To do this, open PowerShell as administrator and execute the > npm install -g windows-build-tools command."

A block of code is set as follows:

<template>
<header>
<div id="blue-portal" />
</header>
</header>

Any command-line input or output is written as follows:

> npm run serve

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Click on the Email button to be redirected to the Email Sign up form"

Warnings or important notes appear like this.
Tips and tricks appear like this.