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
43
Advanced TypeScript for React
glennreyes
0
130
TypeScript Patterns for Better React Components
glennreyes
1
540
GraphQL for React Developers
glennreyes
0
230
When things go wrong, get errors right!
glennreyes
0
160
GraphQL for JS developers
glennreyes
1
190
Building Dapps with React
glennreyes
0
140
Third-Party or Custom Code? The Art of Software Decisions
glennreyes
0
120
UI/UX challenges of Web3 and Dapps
glennreyes
0
200
Other Decks in Programming
See All in Programming
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
260
高専キャリア LT 発表内容
crysta1221
6
5.2k
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.4k
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
470
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
850
まずはプロンプトガイドを読もう、話はそれからだ
kiakiraki
1
240
私のClaude Code活用法 (個人開発編) - PHPerKaigi mini #4(2026/08/24)
panda_program
1
190
Deep dive into the select statement (GopherCon UK)
jespino
0
160
Loosening the Reins: Go Generics Get More Flexible
kuro_kurorrr
0
350
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
480
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
760
Dockerfile CMD for Node.js
grazie1999
0
160
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
400
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
Between Models and Reality
mayunak
4
420
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
64k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
490
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Marketing to machines
jonoalderson
1
5.7k
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!