GraphQL by Example

GraphQL by Example

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 5.5 Hours | 2.11 GB


Learn GraphQL by writing full-stack JavaScript applications with Node.js, Express, Apollo Server, React, Apollo Client.

More and more teams are choosing GraphQL instead of (or along with) REST for their web APIs. GraphQL queries give clients great flexibility in the way they request data from the server, preventing issues such overfetching or underfetching of data, and allowing multiple resources to be retrieved in a single request.

In this course you’ll learn how to use GraphQL both on the server side and in client applications through practical examples in the form of full-stack JavaScript applications. You will be introduced to all the main GraphQL concepts like schema definition, Queries, Mutations, and Subscriptions, as well as to solution to common requirements such as handling authentication/authorization and client-side caching.

The examples use Apollo Server with Node.js and Express on the backend, and Apollo Client with React on the frontend. The aim however is not just to cover specific GraphQL libraries, but to give you a more general understanding of the underlying concepts. For instance, Apollo Client is only introduced after learning how to write a simple client “by hand” to make sure you understand the GraphQL over HTTP format.

That said, there is also a React-specific section at the end covering the latest Apollo Client with React Hooks integration library.

This course assumes good knowledge of modern JavaScript, and ideally some familiarity with Node.js/Express and React.

What you’ll learn

  • Build a GraphQL server based on NodeJS, Express and Apollo Server
  • Invoke GraphQL APIs from JavaScript client applications using regular HTTP requests or Apollo Client
  • Handle Authentication/Authorization, Caching, and more


+ Table of Contents

Introduction
1 What is GraphQL
2 Pre-Requisites
3 Defining a Schema
4 Implementing Resolver Functions
5 Querying with the Query Language
6 Understanding the HTTP Request Format
7 Writing a GraphQL Client

Queries
8 Setting up the Job Board Application
9 Source Code
10 Configuring Apollo Server with Express
11 Note GraphiQL vs GraphQL Playground
12 Returning an Array of Jobs
13 Nested Objects in GraphQL Queries
14 Object Associations Job Company
15 Fetching Jobs in the Client
16 Arguments Returning a Job by ID
17 Query Variables Fetching a Job
18 Handling GraphQL Error Responses
19 Fetching a Company by ID
20 Returning Jobs for a Company

Mutations
21 Creating a Job
22 Best Practices for Mutations
23 Calling a Mutation from the Client

Authentication
24 Enforcing Authentication with the Context
25 Passing Authentication in HTTP Requests
26 Extracting the Company from the Authenticated User

Apollo Client
27 Apollo Client Setup
28 Queries with Apollo Client
29 Authentication with ApolloLink
30 Caching and Fetch Policy
31 Updating the Cache After a Mutation
32 GraphQL Fragments

Subscriptions
33 Note Clear Your Browser Data
34 Chat Application Setup
35 Chat Source Code
36 Chat Application Overview
37 Defining a Subscription
38 Enabling WebSockets in Apollo Server
39 Subscription Resolver with PubSub
40 Configuring WebSocketLink in Apollo Client
41 Using Subscriptions in the Client
42 Inspecting the WebSocket Protocol
43 Client Authentication with WebSockets
44 Server Authentication with WebSockets

Apollo Client with React Hooks
45 React Apollo Three Different Packages
46 Setting up ApolloProvider
47 Introduction to React Hooks
48 The useQuery Hook
49 The useMutation Hook
50 The useSubscription Hook
51 Local State Management with Apollo Client
52 Writing Custom Hooks

Apollo Client 3.0
53 Migrating to Apollo Client 3.0