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)

Creating the AWS Amplify driver for your application

To communicate with AWS Amplify services, we will need to use their SDKs. This process is repetitive and can be merged into a driver for each of the Amplify services we will be using.

In this recipe, we will learn how to create communications drivers, and how to do it with AWS Amplify.

Getting ready

The prerequisites for this recipe are as follows:

  • The previous recipe's project
  • Node.js 12+

The Node.js global objects that are required are as follows:

  • @aws-amplify/cli
  • @quasar/cli

In this recipe, we will use the project from the Adding the GraphQL Client to your application recipe. Please complete the instructions in that recipe first.

How to do it...

In this recipe, we will split it into three parts: the first will be for the AWS Storage driver, the second part will be for the Amplify Auth driver, and finally, we'll see the creation of the Amplify AppSync instance.

Creating the AWS Amplify Storage driver

To create the...