Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
React Finland – React & GraphQL – From zero to ...
Search
Glenn Reyes
April 24, 2019
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React Finland – React & GraphQL – From zero to production
Glenn Reyes
April 24, 2019
More Decks by Glenn Reyes
See All by Glenn Reyes
Dutch AI Conference - Building Interactive Chat Interfaces with MCP-UI
glennreyes
0
33
Advanced TypeScript for React
glennreyes
0
120
TypeScript Patterns for Better React Components
glennreyes
1
540
GraphQL for React Developers
glennreyes
0
220
When things go wrong, get errors right!
glennreyes
0
150
GraphQL for JS developers
glennreyes
1
180
Building Dapps with React
glennreyes
0
130
Third-Party or Custom Code? The Art of Software Decisions
glennreyes
0
110
UI/UX challenges of Web3 and Dapps
glennreyes
0
200
Other Decks in Programming
See All in Programming
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
680
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
120
1年で人数1.5倍、PR数5.5倍増。 品質とアウトカムはどうなったか、 何が効いたか
ike002jp
0
140
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
540
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
act2-costs.pdf
sumedhbala
0
120
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
120
Apache Hive: そしてCloud Native Lakehouseへ
okumin
1
150
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
190
Built Our Own Background Agent at LayerX #aidevex_findy
layerx
PRO
7
2.7k
20260623_Loop Engineeringで自分の分身の問い合わせBotを作る
ryugen04
0
230
言語を使う側から、作る側へ。 自作 Lisp で得た新たな気づき。
andpad
0
130
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
15k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
220
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
370
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
Why Our Code Smells
bkeepers
PRO
340
58k
How to build a perfect <img>
jonoalderson
1
5.8k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
370
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
660
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Fireside Chat
paigeccino
42
4k
Transcript
@glnnrys React & GraphQL From zero to production @glnnrys
@glnnrys > whoami
@glnnrys query getCoach { name twitter job expertise oss(type: "most-popular")
elseIDo } { "data": { "name": "Glenn Reyes", "twitter": "@glnnrys", "job": "Freelance Front-end Engineer", "expertise": ["React", "GraphQL"], "oss": ["graphpack", "react-countup"], "elseIDo": [ "Co-organize React Vienna", "Speak at conferences", "Give workshops" ] } } @glnnrys
@glnnrys Goals for today
@glnnrys
@glnnrys Learn
@glnnrys Fun
@glnnrys Ship
@glnnrys What is GraphQL?
@glnnrys
@glnnrys Query Language for APIs
@glnnrys
@glnnrys Describe your schema in a type system
@glnnrys type Speaker { id: ID! name: String talks: [Talk]!
} type Talk { id: ID! title: String by: Speaker }
@glnnrys It's language agnostic
@glnnrys
@glnnrys Query IDEs
@glnnrys github.com/graphql/graphiql
@glnnrys github.com/prisma/graphql-playground
@glnnrys Automatic documentation
@glnnrys
@glnnrys
@glnnrys
@glnnrys <Query query={gql` query getUser($id: ID!) { user(id: $id) {
id name bio twitter } } `} variables={{ id: props.id }} > {({ data, error, loading }) => { if (loading) return 'Loading ...'; if (error) return `Something went wrong! ${error.message}`; return <Profile data={data.user} />; }} </Query>
@glnnrys Questions?
@glnnrys Let's get started!
@glnnrys github.com/glennreyes/react-graphql-workshop
@glnnrys Schemas & Types
@glnnrys type Person { id: ID! # Not nullable name:
String # Nullable age: Int weight: Float isOnline: Boolean posts: [Post!]! # Not nullable (but empty list is fine) } type Post { id: ID! slug: String! text: String! } type Query { allPersons: [Person!]! personById(id: ID!): Person allPosts: [Post!]! postBySlug(slug: String!): Post } type Mutation { createPost(from: Person!, slug: String!, text: String!): Post! }
@glnnrys Resolver
@glnnrys (obj, args, context, info) => result;
@glnnrys const resolvers = { Query: { personById: (obj, args)
=> API.getPersonById(args.id), }, Person: { posts: obj => API.getPostsByPersonId(obj.id), // All other fields are resolved by default }, };
@glnnrys Apollo Client
@glnnrys import ApolloClient from 'apollo-boost'; import { ApolloProvider } from
'react-apollo'; const client = new ApolloClient({ uri: '[MY_GRAPHQL_ENDPOINT]', headers: { // ... }, }); <ApolloProvider client={client}> <App /> </ApolloProvider>;
@glnnrys Query
@glnnrys import gql from 'graphql-tag'; import { Query } from
'react-apollo'; <Query query={myQuery}> {({ data, loading, error }) => { // ... }} </Query>;
@glnnrys Mutation
@glnnrys import gql from 'graphql-tag'; import { Mutation } from
'react-apollo'; <Mutation mutation={myMutation} variables={{}} onCompleted={data => {}} refetchQueries={[{ query: queryToRefetch, variables: {} }]} awaitRefetchQueries > {mutate => ( // ... )} </Mutation>;
@glnnrys Feedback
@glnnrys Thank you!