Building Vue.js Applications with GraphQL
eBook - ePub

Building Vue.js Applications with GraphQL

  1. 298 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Building Vue.js Applications with GraphQL

About this book

Take your Vue.js knowledge to the next level by understanding full-stack development concepts and exploring modern web technologies such as AWS Amplify, GraphQL, and Quasar FrameworkKey Features• Build a fully functional Vue.js web app and learn how it integrates with GraphQL• Transform your chat application into a Progressive Web Application (PWA) for web deployment• Discover practical recipes, exploring the capabilities of the GraphQL API for full-stack development using Quasar FrameworkBook DescriptionSince 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.What you will learn• Set up your Vue.js projects with Vue CLI and explore the power of Vue components• Discover steps to create functional components in Vue.js for faster rendering• Become familiar with AWS Amplify and learn how to set up your environment• Understand how to create your first GraphQL schema• Use Quasar Framework to create simple and effective interfaces• Discover effective techniques to create queries for interacting with data• Explore Vuex for adding state management capabilities to your app• Discover techniques to deploy your applications effectively to the webWho this book is forThis book is for intermediate-level Vue.js developers who want to take their first step toward full-stack development. Prior knowledge of Vue.js and JavaScript is required before getting started with this book.

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Building Vue.js Applications with GraphQL by Heitor Ramon Ribeiro in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Programming. We have over one million books available in our catalogue for you to explore.

Information

Components, Mixins, and Functional Components
Building a Vue application is like putting a puzzle together. Each piece of the puzzle is a component, and each piece has a slot to fill.
Components play a big part in Vue development. In Vue, each part of your code will be a component – it could be a layout, a page, a container, or a button, but ultimately, it's a component. Learning how to interact with them and reuse them is the key to cleaning up code and performance in your Vue application. Components are the code that will, in the end, render something on the screen, whatever its size might be.
In this chapter, we will learn about how to make a visual component that can be reused in many places. We'll use slots to place data inside our components, create functional components for seriously fast rendering, implement direct communication between parent and child components, and look at loading our components asynchronously.
Then, we'll put all those pieces together and create a beautiful puzzle that's also a Vue application.
In this chapter, we'll cover the following recipes:
  • Creating a visual template component
  • Using slots and named slots to place data inside your components
  • Passing data to your component and validating the data
  • Creating functional components
  • Accessing your children component's data
  • Creating a dynamic injected component
  • Creating a dependency injection component
  • Creating a mixin component
  • Lazy loading your components
Let's get started!

Technical requirements

In this chapter, we will be using Node.js and Vue-CLI.
Attention Windows users: You need to install an npm package called windows-build-tools to be able to install the required packages. To do so, open PowerShell as an administrator and execute the > npm install -g windows-build-tools command.
To install the Vue CLI, you need to open a Terminal (macOS or Linux) or Command Prompt/PowerShell (Windows) and execute the following command:
> npm install -g @vue/cli @vue/cli-service-global

Creating a visual template component

Components can be data-driven, stateless, stateful, or simple visual compone...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. About Packt
  4. Contributors
  5. Preface
  6. Data Binding, Events, and Computed Properties
  7. Components, Mixins, and Functional Components
  8. Setting Up Our Chat App - AWS Amplify Environment and GraphQL
  9. Creating Custom Application Components and Layouts
  10. Creating the User Vuex Module, Pages, and Routes
  11. Creating Chat and Message Vuex, Pages, and Routes
  12. Transforming Your App into a PWA and Deploying to the Web
  13. Other Books You May Enjoy