Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

egghead.io

Create a GraphQL Powered Vue 3 Application

via egghead.io

Overview

Get started building dynamic apps with GraphQL and Vue3.
As your app scales, so does the complexity of managing your routes and API endpoints.
It gets tiresome.
But this aspect of web development can be streamlined considerably!
GraphQL is a powerful tool for querying and mutating your data. In this course, we are going to create a Vue3 app that leverages GraphQL to create a dynamic front end.
But what does GraphQL do?
Its power comes from giving you a single endpoint that you make all your queries to. Instead of making a request to a specific endpoint and getting a fixed response, you can write flexible queries to a single endpoint.
Vue3 has some great new features that we will be exploring, such as the setup script syntax. But you won't just be exploring Vue3's new features, we will be building a dynamic front end with an index, view pages generated from data, and forms.
To make our frontend dynamic, we will be powering it with GraphQL. We start with the basics by creating queries but we move on to more advanced topics such as query params, mutations, and pagination.
To actually use GraphQL in our Vue app we will be using the Vue Apollo Client. Which gives us convenient methods for making queries, getting the data back into the client, and handling errors.
Gain These Skills
Add GraphQL to a Vue 3 project
Query and mutate data with GraphQL in Vue 3
Create data-driven views with Apollo client
Handle routing within a Vue 3 project
Implement optimistic updates and infinite scroll
Prerequisites
Some entry-level knowledge on Vue and GraphQL is recommended, but this course is beginner-friendly enough to where it isn't a strict requirement.
If you want to build a deeper foundation for both Vue and GraphQL we have a couple of awesome courses that you can hack through.
For Vue, check out The Beginner's Guide to Vue 3, which is also by Kevin. It's great for both newcomers to web dev and veterans alike.
And for GraphQL, work through GraphQL Query Language from Eve Porcello. Eve literally wrote the book on learning GraphQL and her course is similarly top quality.
What's Next?
Progressive Web Apps are a more advanced topic, and converting an existing Single Page Vue App into one makes for an excellent follow-up project. -> Offline-First Progressive Web Apps (PWA) in Vue.js
If you want to take your GraphQL game to the next level, then becoming an expert in designing GraphQL schemas is the way to go. -> Designing GraphQL Schemas
And I know **the following recommendation is a React course but it really is that good. You will learn some advanced techniques that will be applicable to Vue or any other Apollo compatible framework that you work with. -> Manage State in React Apps with Apollo Client and GraphQL

Syllabus

  • Generate a MongoDB Database for a GraphQL Backend
  • Create a Vue 3 Project with Vite
  • Set Up the Apollo Client in a Vue 3 Project
  • Compare Vue 3 Setup Script with the Options API
  • Encapsulate Logic with Vue 3 Composable
  • Provide DefaultApolloClient from Apollo Composable to your Vue 3 App
  • Create a Data-Driven Vue 3 Component with Apollo
  • Create a Data-Driven Child Component in Vue 3
  • Add Routing to Your Vue 3 Application With Vue Router
  • Create a Dynamic Route With Vue Router
  • Use Template Literals with router-link to Create Dynamic Routes in Vue 3
  • Pass an Id in a Vue 3 app through Query Parameters to a GraphQL Query
  • Create a Conditionally Rendered Modal in Vue 3
  • Listen for Custom Emitted Events in Vue 3 Parent Components
  • Create a Vue 3 Form With v-model
  • Create a GraphQL Mutation in GraphiQL
  • Use GraphQL Mutations in Vue 3 with the useMutation Composable
  • Use Refetch from Vue 3 useQuery Composable to Ensure Fresh Data
  • Handle Optimistic Updates With the Vue 3 useMutation Composable
  • Handle GraphQL Request Errors in Vue 3
  • Implement an Infinite Scroll using GraphQL with the Vue 3 useQuery Composable

Taught by

Kevin Cunningham

Reviews

4.2 rating at egghead.io based on 7 ratings

Start your review of Create a GraphQL Powered Vue 3 Application

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.