\newlinenewline logonewline logo
    • Learn

      Learn

      Learn web development from expert teachers. Build real projects, join our community, and accelerate your career

      Get Started
      Fullstack RustFullstack Node.jsFullstack D3Fullstack ReactFullstack React with TypeScriptmore →
      https://dzxbosgk90qga.cloudfront.net/fit-in/620x372/n/20220117210542194_21CB9CF5-AA2C-4939-BCC1-18F0377EFB90.png

      The newline Guide to Building Your First GraphQL Server with Node and TypeScript

      In this course, we'll show you how to create your first GraphQL server with Node.js and TypeScript

      Enroll for free
    • Teach

      Teach

      Share your knowledge with others, earn money, and help people with their career

      Apply Now
      Apply To Teach A CourseWhat Our Teachers Say
      Amelia Wattenberger

      Amelia Wattenberger

      Author of Fullstack D3

      "Writing Fullstack D3 was a thoroughly enjoyable, fun process.

      The writing was over before I knew it, and we've sold way more copies than I expected! Plus, the compliments from my peers have been really amazing."

    • Community

      Community

      Get help with programming projects, find collaborators, and make friends

      Join Now
      Join our Discord ServerWhat Our Students Say
    • Tutorials
    Go Pro
    Log In
     

    Fullstack GraphQL

    Welcome:

    Start Here

    Chapter 1:

    What to Expect from this book

    • What is GraphQL
    • Why GraphQL?
    • Self-descriptive
    • Usage driven and Intuitive
    • The N+1 Problem
    • GraphQL vs REST and GRPC-Web
    • REST (with Swagger)
    • GRPC-Web
    • GraphQL
    • Prerequisites
    • Running Code Examples
    • Windows
    • Mac
    • Linux
    • Code Blocks And Context
    • Code Block Numbering
    • Reporting Issues
    • Getting Help
    • Join Our Discord

    Chapter 2:

    Hello GraphQL - GraphiQL and Github's GraphQL Playground

    • Enter GraphiQL
    • Our First Query
    • Named Queries
    • Variables
    • GraphQL Enforces Types and Correctness
    • GraphQL doesn't accept extra variables
    • Multiple Queries and Renaming Result fields
    • Fragments
    • Union Types and Interfaces
    • Interfaces
    • Discriminated Unions
    • Pagination
    • Mutations
    • GraphQL queries over HTTP - fetching with fetch and curl
    • Summary

    Chapter 3:

    Hello GraphQL from Node

    • A GraphQL Hello World from Node
    • Making Changes with Mutations
    • Summary

    Chapter 4:

    Hello GraphQL in the Browser

    • A GraphQL Hello World from Localhost
    • Putting the Query in the App
    • Creating a Custom Hook
    • Making Updates with Mutations
    • Handling User Input
    • Summary

    Chapter 5:

    Picking a GraphQL Client

    • GraphQL is just JSON over HTTP (well, usually)
    • Why You Might Want a Dedicated GraphQL Client
    • So What Are The Options?
    • graphql-request
    • urql
    • Relay Modern
    • Apollo Client
    • What to Choose?

    Chapter 6:

    The Basics of Apollo Client and React

    • Apollo Client
    • Getting Hooked on useQuery
    • Getting hooked on useMutation
    • How to use Apollo Client across your app
    • ApolloClient and Testing Components
    • Setting up the Mocked Provider
    • Testing State
    • Transition from loading to loaded State
    • Remember

    Chapter 7:

    Building a TypeSafe GraphQL React Client App - Part 1

    • What are we building?
    • Tooling and Project Structure
    • TypeScript and GraphQL Types - There is a difference
    • Generating Types with graphql-codegen
    • Generating Types for Queries
    • Generating Helper Functions for Apollo
    • Building the Issue Finder
    • Creating the Search Component
    • Visualizing Issues
    • Pagination with Cursors
    • Tracking our cursorState
    • Improved Caching during Pagination
    • Summary

    Chapter 8:

    Building a TypeSafe GraphQL React Client App - Part 2

    • What are we building?
    • Prefetching Queries
    • Loading Comments
    • Extending GetIssues Query
    • Dedicated Query
    • Hybrid Approach
    • Mutations - Modifying Existing Data
    • Mutations - Creating New Data
    • Refetching Queries
    • Manually Updating the Apollo Cache
    • Pagination via fetchMore
    • Summary
    • What's Next?
    • FAQ
    • What happens if an endpoint does not provide an unique Id as a field?
    • Summary

    Chapter 9:

    Your First GraphQL Server with Apollo Server

    • Getting started
    • Schema
    • The Obligatory Boilerplate
    • Mocking the Data
    • Configuring Mocks
    • Resolvers
    • Chaining Resolvers
    • Passing Arguments
    • Summary

    Chapter 10:

    Using GraphQL Servers with A Database

    • Getting Started
    • Using GraphQL with a Database
    • Queries with pagination
    • Offset pagination
    • Cursor pagination
    • Writing Mutation Resolvers
    • Handling Errors
    • Summary

    Chapter 11:

    Caching and Batching

    • Optimized queries
    • Batching
    • Caching
    • Cost computation
    • Summary

    Chapter 12:

    Authentication and Authorization in GraphQL

    • JWT
    • Resolver Authentication
    • Context Authentication
    • Schema Authentication
    • Directives
    • Custom directives
    • Mutations and authorization
    • Summary

    Chapter 13:

    Code First GraphQL with TypeORM and TypeGraphQL

    • TypeGraphQL
    • Implementing Pagination
    • Using Context in a Resolver
    • TypeORM
    • Configuring Context
    • Navigating Relationships
    • OneToMany with TypeORM
    • Authorization with TypeGraphQL
    • Summary
    • More on TypeGraphQL

    Chapter 14:

    Where to Go From Here? Advanced GraphQL

    • What did you think?
    • Awesome GraphQL
    • Say Hello

Welcome to

Fullstack GraphQL

The Complete Guide to Writing GraphQL Servers and Clients with TypeScript

Example Code Download

You can download the complete example code for this book by clicking here.

Table of Contents

What to Expect from this book
Hello GraphQL - GraphiQL and Github's GraphQL Playground
Hello GraphQL from Node
Hello GraphQL in the Browser
Picking a GraphQL Client
The Basics of Apollo Client and React
Building a TypeSafe GraphQL React Client App - Part 1
Building a TypeSafe GraphQL React Client App - Part 2
Your First GraphQL Server with Apollo Server
Using GraphQL Servers with A Database
Caching and Batching
Authentication and Authorization in GraphQL
Code First GraphQL with TypeORM and TypeGraphQL
Where to Go From Here? Advanced GraphQL
Next Chapter:
What to Expect from this book

Learn

  • Fullstack React
  • ng-book
  • Fullstack D3
  • Fullstack Node.js
  • Fullstack React Native
  • Fullstack Rust

Requests

  • Request a Course
  • Request a Site Feature

Community

  • Student stories
  • Community Discord

Masterclasses

  • Learnify: Learn advanced ASP.NET Core, Entity Framework Core and React
  • Tinyhouse: Fullstack React Masterclass
  • Fullstack Flask: Build a SaaS Masterclass
  • Fullstack D3 Masterclass
  • Fullstack React with TypeScript Masterclass

Tutorials

  • React Tutorials
  • Node.js Tutorials
  • Rust Tutorials
newline

Latest Book

Fullstack React with TypeScript

Fullstack React with TypeScript

Learn this

Learn Pro Patterns for Hooks, Testing, Redux, SSR, and GraphQL

Get access to our free email tutorials

  • Terms of Service
  • Privacy
  • ©2023 Fullstack.io, LLC