Skip to main content

GraphQL for beginners with JavaScript

5h 35m 31s
English
Paid

Discover why it's time to rethink REST APIs and embrace GraphQL with JavaScript for optimized server communication.

Why Move from REST to GraphQL?

REST has been the go-to method for interacting with servers for decades, but with the rapid evolution in software development, it's essential to assess whether it still fits today's needs. Let's explore some common issues associated with REST APIs and how GraphQL addresses them.

Common REST API Challenges

1. Many Concurrent Requests

Apps often make numerous concurrent REST API calls, which can slow down performance, especially on mobile devices with weak connections, leading to a poor user experience. GraphQL solves this by consolidating all data queries into a single server request, significantly enhancing performance.

2. Multiple Round Trips (Under-fetching & N+1 Problem)

REST API calls can require multiple round trips to gather data, resulting in slower apps and increased server load. GraphQL allows rich queries in one request, mitigating the N+1 problem.

3. Over-fetching Data

REST APIs may provide more data than needed, leading to unnecessary bandwidth usage and reduced performance. GraphQL enables precise data fetching, ensuring you only receive what you request.

4. Discoverability & Documentation

Understanding existing REST APIs can be daunting without proper documentation. GraphQL's features facilitate the creation of developer tools like GraphiQL, enhancing API discoverability.

5. Slow Development

Waiting on backend developers can hinder progress. With GraphQL, frontend adjustments often don't require backend changes, allowing faster feature releases and improved agility.

6. Custom Endpoints & Duplicate Code

To overcome REST limits, developers create custom endpoints, but this leads to duplicated server-side code. GraphQL reuses server-side code across different queries by default.

These are just a few REST API problems. GraphQL solves these and more, which you'll explore in this course.

Course Overview

If you're a JavaScript developer eager to improve application performance and the developer experience, this course is tailored for you.

Course Structure

GraphQL: Two Core Components

  • A Query Language for data retrieval.

  • A Server Runtime for fulfilling queries.

Learning Objectives

  • Explore scalar and object types, query parameters, variables, and more.
  • Understand GraphQL server setup using Node.js and PostgreSQL.
  • Learn to build and connect a GraphQL server for a project app.

Pre-requisites

Familiarity with modern JavaScript is essential for this course.

Project Highlight

You will develop Hacker Book Review – a book review app, by creating and connecting GraphQL queries and servers.

Instructor Approach

I prioritize practical content with clear visuals and animations. Courses are concise, well-structured, and high-quality.

Course Details

  • Course Length: Over 5 hours of targeted content split across more than 50 videos and hands-on exercises.
  • Completion Time: Flexible pacing; complete over a weekend or at your leisure.
  • Learning Outcome: Gain in-depth understanding and practical skills to create and use GraphQL servers.

Requirements

  • Familiarity with Modern JavaScript
  • A desire to learn cutting-edge technology

Target Audience

  • Frontend and Backend JavaScript developers keen to understand and apply GraphQL APIs

What You'll Learn

  • Understand the benefits of GraphQL over REST APIs.
  • Learn how GraphQL addresses over-fetching and under-fetching issues.
  • Discover how to minimize concurrent HTTP requests using GraphQL.
  • Avoid the N+1 problem with efficient data fetching.
  • Enhance API discoverability with GraphQL features.
  • Build and utilize GraphQL APIs from scratch with JavaScript.
  • Achieve superior application performance and team agility with GraphQL.

About the Author: udemy

udemy thumbnail
By connecting students all over the world to the best instructors, Udemy is helping individuals reach their goals and pursue their dreams. Udemy is the leading global marketplace for teaching and learning, connecting millions of students to the skills they need to succeed. Udemy helps organizations of all kinds prepare for the ever-evolving future of work. Our curated collection of top-rated business and technical courses gives companies, governments, and nonprofits the power to develop in-house expertise and satisfy employees’ hunger for learning and development.

Watch Online 57 lessons

This is a demo lesson (10:00 remaining)

You can watch up to 10 minutes for free. Subscribe to unlock all 57 lessons in this course and access 10,000+ hours of premium content across all courses.

View Pricing
0:00
/
#1: Why GraphQL?
All Course Lessons (57)
#Lesson TitleDurationAccess
1
Why GraphQL? Demo
05:25
2
The Problems with REST
09:48
3
What We'll Be Building
06:30
4
The Graph in GraphQL
05:26
5
What is GraphQL?
04:58
6
First GraphQL Query
05:52
7
Discoverability
07:43
8
First GraphQL Server - Part 1
05:10
9
First GraphQL Server - Part 2
10:32
10
GraphQL Data types Introduction
04:35
11
Scalar Types
05:28
12
Object Types
04:46
13
Query Parameters
07:55
14
Variables
06:03
15
Interfaces
04:58
16
Aliases & Fragments
10:10
17
Union Types
06:52
18
Directives
03:56
19
Mutations and Input Types
05:08
20
Errors
03:12
21
GraphQL without GraphiQL
10:50
22
Server Planning
02:02
23
Review Starter Project
04:49
24
Installing PostgreSQL
01:21
25
Installing PostgreSQL on Windows
03:55
26
Installing PostgreSQL on Linux
02:32
27
Installing PostgreSQL on Mac
02:00
28
Introduction To SQL
12:41
29
Create / Setup App Database
08:32
30
Create a GraphQL HTTP Server
06:34
31
Add GraphQL 'Books' Field
07:29
32
Query Books from the Database
05:10
33
Challenge Review - Adding 'subtitle' & 'ratingCount' Fields
03:22
34
Add ImageUrl field to book type
06:44
35
Add authors field to book type
07:34
36
Optimize with the Dataloader - Part 1
10:42
37
Optimize with the Dataloader - Part 2
09:56
38
Add GraphQL 'reviews' Field
03:07
39
Add 'book' field to Review Type
14:46
40
Challenge Review - Add 'book' field to Review type
03:43
41
Sorting Queries
07:21
42
Create Home Page Query
03:02
43
Use the Home Page Query in HackerBook Review App
11:16
44
Create Book Detail Page Query
03:45
45
Add 'book' field to Review Type
05:35
46
Add Query to Book Page in HackerBook Review App
05:32
47
Query 'book' for Book Review Page in HackerBook Review App
03:18
48
Create Book Review Mutation
06:58
49
Use the Book Review Mutation in HackerBook Review App
03:33
50
Add 'searchBook' field to query Google Book API
05:49
51
Use 'searchBook' field in HackerBook Review App
03:08
52
Add 'createBook' mutation
05:27
53
Use 'createBook' mutation in HackerBook Review App
02:19
54
Add a Global 'search' field
09:34
55
Miscellaneous & Cleanup
01:45
56
GraphQL / Versionless
03:41
57
Final Thoughts
01:12
Unlock unlimited learning

Get instant access to all 56 lessons in this course, plus thousands of other premium courses. One subscription, unlimited knowledge.

Learn more about subscription