From 8b98821144312014f64d237fc0cf334022ea743c Mon Sep 17 00:00:00 2001 From: Lauri Svan Date: Mon, 30 Nov 2020 23:50:40 +0200 Subject: [PATCH] Add navigation --- README.md | 2 ++ docs/1_Simple_GraphQL_Queries.md | 11 ++++++++--- docs/2_Bootstrap.md | 16 ++++++++++++++-- docs/3_Simple_Backend.md | 13 ++++++++----- docs/4_Refined_Backend.md | 9 +++++++-- docs/5_Bootstrap_Frontend.md | 17 +++++++++++++---- docs/6_Custom_DataTypes_Data_Loaders.md | 14 +++++++++----- docs/7_Authentication_and_Access_Control.md | 12 ++++++++++-- docs/8_Beyond_Basics.md | 12 ++++++++++++ 9 files changed, 83 insertions(+), 23 deletions(-) create mode 100644 docs/8_Beyond_Basics.md diff --git a/README.md b/README.md index 1578dc8..d78e5aa 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ As a part of this workshop, we will 1. Write a simple React frontendto connect to the backend 1. Add custom datatypes and write faster resolvers using Data Loaders 1. Add JWT based authentication & role based access control +1. Give some pointers for your further studies ## Prerequisities @@ -39,3 +40,4 @@ If you are using VS.code (recommended), you will also benefit from the following - [Debugger for Chrome](https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome) - [GraphQL](https://marketplace.visualstudio.com/items?itemName=Prisma.vscode-graphql) +When you are ready, let's move to the [Chapter 1: Simple GraphQL Queries](docs/1_Simple_GraphQL_Queries.md)! \ No newline at end of file diff --git a/docs/1_Simple_GraphQL_Queries.md b/docs/1_Simple_GraphQL_Queries.md index 1f9cee8..147d82e 100644 --- a/docs/1_Simple_GraphQL_Queries.md +++ b/docs/1_Simple_GraphQL_Queries.md @@ -1,6 +1,6 @@ -# Writing GraphQL Queries +# Simple GraphQL Queries -This sections introduces you to querying GraphQL APIs through a few popular APIs. +This chapter introduces you to querying GraphQL APIs through a few popular APIs. ## Basic Queries @@ -52,4 +52,9 @@ query { ## References * [GitHub API docs](https://docs.github.com/en/free-pro-team@latest/graphql/guides/using-the-explorer) -* [GitHub token settings](https://github.com/settings/tokens) \ No newline at end of file +* [GitHub token settings](https://github.com/settings/tokens) + +## Navigation + +* [Index](../README.md) +* [Next Chapter](2_Bootstrap.md) \ No newline at end of file diff --git a/docs/2_Bootstrap.md b/docs/2_Bootstrap.md index 0dcffff..99c222f 100644 --- a/docs/2_Bootstrap.md +++ b/docs/2_Bootstrap.md @@ -1,4 +1,6 @@ -# Bootstrap your stack +# Bootstrap Your Stack + +This chapter bootstraps a simple Node.js/TypeScript/Apollo server stack. ### Initialise the Backend and Tooling Dependencies @@ -60,4 +62,14 @@ jq '.main = "build/index.js"' package.json | sponge package.json jq -r '.scripts.start = "node ."' package.json | sponge package.json jq -r '.scripts.watch = "nodemon --watch build --watch schema.graphql"' package.json | sponge package.json jq -r '.scripts.build = "tsc -b --incremental"' package.json | sponge package.json -jq -r '.scripts.build_watch = "tsc -b --watch"' package.json | sponge package.json \ No newline at end of file +jq -r '.scripts.build_watch = "tsc -b --watch"' package.json | sponge package.json +``` + +## References + +* [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript) + +## Navigation + +* [Previous Chapter](1_Simple_GraphQL_Queries.md) +* [Next Chapter](3_Simple_Backend.md) \ No newline at end of file diff --git a/docs/3_Simple_Backend.md b/docs/3_Simple_Backend.md index c0cbccc..0348e53 100644 --- a/docs/3_Simple_Backend.md +++ b/docs/3_Simple_Backend.md @@ -1,6 +1,6 @@ -# Bootstrap a Node.js/TypeScript/Apollo Server stack +# A Simple Backend -This section helps to bootstrap a a basic Apollo Server stack that uses +This chapter helps to bootstrap a a basic Apollo Server stack that uses TypeScript. You will likely want to fine tune it for your preferences later. ### Create a Minimal Server and Schema @@ -66,6 +66,9 @@ open http://localhost:4000 ## References -* [Get started with Apollo Server](https://www.apollographql.com/docs/apollo-server/getting-started/) -* [eslint-config-standard-with-typescript](https://github.com/standard/eslint-config-standard-with-typescript) -* [@sindresorhus/tsconfig](https://www.npmjs.com/package/@sindresorhus/tsconfig) +* [Get started with Apollo Server](https://www.apollographql.com/apollo-server/getting-started/) + +## Navigation + +* [Previous Chapter](2_Bootstrap.md) +* [Next Chapter](4_Refined_Backend.md) \ No newline at end of file diff --git a/docs/4_Refined_Backend.md b/docs/4_Refined_Backend.md index f7bac16..8c410d4 100644 --- a/docs/4_Refined_Backend.md +++ b/docs/4_Refined_Backend.md @@ -1,6 +1,6 @@ -# Writing Resolvers +# Writing a Refined Backend -This section refines the basic bootstrap to a full API: +This chapter refines the basic bootstrap to a full API: 1. Create the Data Models using [sequelize-typescript](https://www.npmjs.com/package/sequelize-typescript) 1. Create TypeScript typings from schma using [GraphQL Code Generator](https://graphql-code-generator.com/) 1. Bind them together using [GraphQL Modules](https://graphql-modules.com/) @@ -282,3 +282,8 @@ Add sample data to the database, and watch the first resolvers to be loaded! - [GraphQL Code Generator](https://graphql-code-generator.com/) - [GraphQL Modules](https://graphql-modules.com/) - [TypeGraphQL - define GraphQL types with annotations](https://typegraphql.ml/) + +## Navigation + +* [Previous Chapter](3_Simple_Backend.md) +* [Next Chapter](5_Bootstrap_Frontend.md) \ No newline at end of file diff --git a/docs/5_Bootstrap_Frontend.md b/docs/5_Bootstrap_Frontend.md index 946ed41..1b1489f 100644 --- a/docs/5_Bootstrap_Frontend.md +++ b/docs/5_Bootstrap_Frontend.md @@ -1,9 +1,18 @@ -# Bootstrap a React / Apollo Client App +# Bootstrap the Frontend and Dive Deeper into Queries -## Building a GraphQL Client +This chapter bootstraps a simple React/Apollo Client app that connects your backend. -## Querying for data +## Add Apollo Client -## Mutating data +## Generate Simple Queries With GraphQL CodeGen + +## Querying for Data + +## Mutating Data ## Using Fragments (for recurring fetch patterns) + +## Navigation + +* [Previous Chapter](4_Refined_Backend.md) +* [Next Chapter](6_Custom_DataTypes_Data_Loaders.md) \ No newline at end of file diff --git a/docs/6_Custom_DataTypes_Data_Loaders.md b/docs/6_Custom_DataTypes_Data_Loaders.md index 946ed41..66e7dbb 100644 --- a/docs/6_Custom_DataTypes_Data_Loaders.md +++ b/docs/6_Custom_DataTypes_Data_Loaders.md @@ -1,9 +1,13 @@ -# Bootstrap a React / Apollo Client App +# Custom DataTypes, Data Loaders and Oh My! -## Building a GraphQL Client +This chapter refines your GraphQL knowledge to custom data types, Data Loaders and other topics +that are beyond basics but that everybody needs. +### Nested resolvers -## Querying for data +### Custom Types (JSON, UUID etc.) -## Mutating data +### Data Loaders (Solving the N+1 Problem & Caching) +## Navigation -## Using Fragments (for recurring fetch patterns) +* [Previous Chapter](5_Bootstrap_Frontend.md) +* [Next Chapter](7_Authentication_and_Access_Control.md) \ No newline at end of file diff --git a/docs/7_Authentication_and_Access_Control.md b/docs/7_Authentication_and_Access_Control.md index a7f913d..5b24979 100644 --- a/docs/7_Authentication_and_Access_Control.md +++ b/docs/7_Authentication_and_Access_Control.md @@ -1,4 +1,7 @@ -# Supplementary Topics +# Authentication and Access Control + +Most APIs need access control, and this chapter shows an implementation of one of the most common +solutions, e.g. JWT based authentication and role based access control. ## Authentication and Access Control Using JWTs @@ -6,4 +9,9 @@ ### Role Based Access Control Using GraphQL Directives -### Adding authentication to the Frontend \ No newline at end of file +### Adding Authentication to the Frontend + +## Navigation + +* [Previous Chapter](6_Custom_DataTypes_Data_Loaders.md) +* [Next Chapter](8_Beyond_Basics.md) \ No newline at end of file diff --git a/docs/8_Beyond_Basics.md b/docs/8_Beyond_Basics.md new file mode 100644 index 0000000..2b526dd --- /dev/null +++ b/docs/8_Beyond_Basics.md @@ -0,0 +1,12 @@ +# Beyond Basics + +This chapter gives pointers for your further studies. + +## GraphQL Specification + +## Subscriptions + +## API Federation + +* [Previous Chapter](7_Authentication_and_Access_Control.md) +* [Index](../README.md) \ No newline at end of file