Обучающие видео » Компьютерные видеоуроки и обучающие интерактивные DVD » Программирование (видеоуроки)
Client-Side GraphQL in ReactГод выпуска: 2019
Производитель: frontendmasters.com
Сайт производителя:
https://frontendmasters.com/courses/client-graphql-react/Автор: Scott Moss
Продолжительность: 2 hours, 53 min
Тип раздаваемого материала: Видеоклипы
Язык: Английский
Описание: Learn to use GraphQL on the client-side using React with Apollo Client. In this course, you'll use queries and mutations to fetch and update GraphQL API data. You'll go further with variables, inputs, aliases on fields. Then attach your queries and mutations to React and interact with an Apollo Server using React hooks to build amazing things with React and GraphQL!
Published: December 3, 2019
Course Slides
https://static.frontendmasters.com/resources/2019-10-14-full-stack-graphql/client-graphql-react.pdfCourse Code
https://github.com/FrontendMasters/fullstack-graphqlSpecial note Access to courses was provided by one of the rutracker users who wants to stay anonymous let's say all thanks to him, and i just downloaded it[spoiler="Содержание"]
Table of Contents
Introduction
Introduction
00:00:00 - 00:06:39
Introduction
Scott Moss defines GraphQL as a declarative query language that clients can use to ask an API for the data needed, and explains how this course will focus on using GraphQL with React on the front end. -
https://static.frontendmasters.com/resources/2019-10-14-full-stack-graphql/client-graphql-react.pdf https://github.com/FrontendMasters/fullstack-graphqlGraphQL Playground
00:06:40 - 00:12:11
GraphQL Playground
Scott explains that using GraphQL on the front end means issuing requests to execute queries and mutations, shares the GraphQL spec, and demonstrates how to use the GraphQL playground.
GraphQL Basics
Operation Names
00:12:12 - 00:16:47
Operation Names
Scott defines operation names as unique names for the GraphQL client side query and mutation operations. Operation names are used by tools like the GraphQL playground to reference different operations. -
https://static.frontendmasters.com/resources/2019-10-14-full-stack-graphql/client-graphql-react.pdfQuery Operation
00:16:48 - 00:22:54
Query Operation
Scott demonstrates how to write a query operation in GraphQL by declaring a variable, and setting a variable's type and value.
Multiple Queries & Mutations
00:22:55 - 00:32:09
Multiple Queries & Mutations
Scott explains that multiple queries can run within the same API call, demonstrates how to write a mutation operation, and answers questions about caching in mutations, and what is sent to the API when querying.
Apollo Client Tool
00:32:10 - 00:35:27
Apollo Client Tool
Scott defines Apollo Client as an encapsulation of http logic and a client side state management tool, and answers questions about how to use Apollo Client for state management.
Storing API Data
00:35:28 - 00:41:34
Storing API Data
Scott explains that every node or object that gets returned from the API is stored in a local cache by ID and typename. It is considered best practice to save nodes using the default ID.
Apollo React
Apollo Client & API Querying
00:41:35 - 00:53:24
Apollo Client & API Querying
Scott demonstrates how to write an Apollo client, links it to an API, exports it as the default client, and writes a new query. -
https://static.frontendmasters.com/resources/2019-10-14-full-stack-graphql/client-graphql-react.pdfApollo Client & Hooks
00:53:25 - 00:58:42
Apollo Client & Hooks
Scott explains that Apollo creates hooks to facilitate interactions with GraphQL on the client side. Whenever a hook is used, in this case useState, it will have an array of two elements, the first one is the initial state property, the second is a function updating or changing the initial state. When using the hook, the default state is passed.
Querying Data Exercise
00:58:43 - 01:06:01
Querying Data Exercise
Scott demonstrates that the useQuery hook needs a query to function properly, and codes a new query for that specific hook. Students are instructed to write a query for the client to fetch data.
Querying Data Solution
01:06:02 - 01:15:08
Querying Data Solution
Scott live codes the solution to the querying data exercise.
Querying Mutations Demo
01:15:09 - 01:21:44
Querying Mutations Demo
Scott demonstrates how to query a mutation, and explains that contrary to other forms of querying, mutations will contain arguments to let the server know what to mutate.
Querying Mutations Exercise
01:21:45 - 01:28:16
Querying Mutations Exercise
Students are instructed to query the mutation that Scott live coded using the useMutation hook.
Querying Mutations Solution
01:28:17 - 01:38:52
Querying Mutations Solution
Scott live codes the solution to the querying mutations exercise.
Caching
Caching & Synchronicity
01:38:53 - 01:50:09
Caching & Synchronicity
Scott explains how to keep the cache in sync by refetching matching queries after a mutation, using the update method on a mutation and watching queries. Questions from the audience are answered about latency, caching vs. requerying the database, and querying the client vs. querying using a hook. -
https://static.frontendmasters.com/resources/2019-10-14-full-stack-graphql/client-graphql-react.pdfUpdating the Cache
01:50:10 - 01:56:13
Updating the Cache
Scott explains how to reference a cache in the update method, how to read queries after the cash, and save the changes. Clarifications are made about querying and caching in GraphQL.
Cache Update Exercise
01:56:14 - 01:56:47
Cache Update Exercise
Students are instructed to use a mutation to update the cache.
Cache Update Solution
01:56:48 - 02:01:39
Cache Update Solution
Scott live codes the solution to the cache update exercise.
Optimistic UI
Optimistic UI Updates
02:01:40 - 02:15:15
Optimistic UI Updates
Scott demonstrates that optimistic UI avoids delays, by allowing a local update before any server update occurs. Optimistic UI updates itself, anticipates the response from the API, and proceeds as if the API call was synchronous. -
https://static.frontendmasters.com/resources/2019-10-14-full-stack-graphql/client-graphql-react.pdfOptimistic UI Exercise
02:15:16 - 02:16:26
Optimistic UI Exercise
Scott instructs the students to create an optimistic response so that the UI updates immediately.
Optimistic UI Solution
02:16:27 - 02:23:17
Optimistic UI Solution
Scott live codes the solution to the Optimistic UI exercise, and answers questions about error handling and optimistic response in a mutation vs. a query.
Directives & Fragments
Client Side Schemas
02:23:18 - 02:33:16
Client Side Schemas
Scott demonstrates how to manage local state with Apollo, and GraphQL using client side schemas and adding a directive. -
https://static.frontendmasters.com/resources/2019-10-14-full-stack-graphql/client-graphql-react.pdfFragments
02:33:17 - 02:38:38
Fragments
Scott explains that instead of duplicating fields within different queries, one can use fragments, and demonstrates how to write and add fragments.
Fragments Exercise
02:38:39 - 02:39:13
Fragments Exercise
Students are instructed to write fragments for every types, and make sure to add them to the mutations too.
Fragments Solution
02:39:14 - 02:40:53
Fragments Solution
Scott live codes the solution to the fragments exercise.
Apollo Directives
02:40:54 - 02:44:21
Apollo Directives
Scott describes the different directives that exist on the client side, namely `skip` and `include`. Experimental directives that need third party to function such as defer and live are mentioned.
Wrapping Up
Wrapping Up
02:44:22 - 02:53:28
Wrapping Up
Scott wraps up the course, recommends additional tools including GraphQL voyager, onegraph, Apollo, and fly.io. Awesome GraphQL, specifically the graphql-code-generator, is also highlighted as a good GraphQL open source. -
https://static.frontendmasters.com/resources/2019-10-14-full-stack-graphql/client-graphql-react.pdf[/spoiler]
Файлы примеров: присутствуют
Формат видео: MP4
Видео: AVC, 1920x1080, 16:9, 30fps, ~1200kb/s
Аудио: AAC, 44.1kHz, ~244kb/s, stereo
[spoiler="Скриншоты"]

[/spoiler]