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
30
Advanced TypeScript for React
glennreyes
0
120
TypeScript Patterns for Better React Components
glennreyes
1
530
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
OSもどきOS
arkw
0
590
作って学ぶ、 JSX (TSX) ランタイムの基本
syumai
7
1.7k
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
220
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
260
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
200
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.4k
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
110
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
410
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
300
The ROI of Quarkus for Spring Boot Applications
hollycummins
0
140
これからAgentCoreを触る方へトレンドはGatewayです
har1101
2
180
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
310
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
Context Engineering - Making Every Token Count
addyosmani
9
990
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
190
How to Ace a Technical Interview
jacobian
281
24k
Crafting Experiences
bethany
1
190
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
55k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Why Our Code Smells
bkeepers
PRO
340
58k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
290
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!