Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GraphQL: Not just for Facebook anymore
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Andri Óskarsson
October 09, 2019
Technology
49
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GraphQL: Not just for Facebook anymore
I did a short talk at our local Frontend Meetup in Aalborg. Slides are for anyone interested.
Andri Óskarsson
October 09, 2019
Other Decks in Technology
See All in Technology
宣言型部分更新は何を解決しどこへ向かうのか
shuta13
1
450
AI駆動で「他アプリの音を加工できる」アプリを作った
satomasahiro2005
0
150
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
170
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
130
パスキーの自動テストはどこまでいけるのか
teamlab
PRO
0
210
Temporal 最高!でも改めて「日付」について調べたら人類の負債すぎる件
riyaamemiya
0
150
Active Record Connection Adaptersにおける長年の課題に再び取り組む
yahonda
0
150
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
330
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
860
USB PDを使ってスマホを労わりたい
raspython3
0
180
AI時代のPRレビューにどう向き合うか?
kairim0
1
240
AIがコードを書く時代に、エンジニアは何で自分の価値を証明するのか / In an era where AI writes code how do engineers prove their value
carta_engineering
3
1.1k
Featured
See All Featured
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Ruling the World: When Life Gets Gamed
codingconduct
0
400
WCS-LA-2024
lcolladotor
0
890
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
460
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
930
Side Projects
sachag
456
43k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
520
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Balancing Empowerment & Direction
lara
6
1.3k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
We Have a Design System, Now What?
morganepeng
55
8.4k
Transcript
GraphQL Not just for Facebook anymore
Hi! I'm Andri Computer Engineer from Iceland React user since
2016 GraphQL in production since 2018 Co-organiser at Aalborg Frontend Meetup @andrioid on Twitter
Solutions for libraries, education, museums and more. www.redia.dk
Goal of this talk Hopefully convince you of the benefits
of using GraphQL What is GraphQL Problems we didn't knew we had GraphQL features How to get started
What is GraphQL? Made by Facebook for their "Graph API"
Describes API layouts, types and data Language and protocol agnostic Not a graph. More like a tree.
Problems We didn't know we had
None
Multiple resources per view Apps Live updates Typed JavaScript
Who owns the API?
Backend decides Multiple API calls per view Frontend does data
processing and object merging Messy frontend code Lodash is a symptom, not a cure
Frontend decides Backend views created on API endpoint (combined data)
Backend needs to add every field Performance implications Code duplication Messy backend code
Developers lose Maybe not a big loss, but loss Different
departments have different priorities Maybe different work-load between frontend/backend
GraphQL Features
Schema API, Types, Data
Works with your language Flow Go JavaScript TypeScript Reason More...
Keeps the frontend clean No need for const moo =
animals && animals.mammals && animals.mammals.cow && animals.mammals.cow.says(); When you know exactly what the data looks like Focus on the presentation, not the data
It's fast! Parallel fetching, when possible Dataloaders reduce round-trips More
productive frontend developers Client Caching
Documentation Discover an API with introspect queries Local and remote
tools Descriptions and type definitions Deprecated? Just add @deprecated
You convinced me! How do I get started?
Frontend Apollo Client (React, Angular, Vue, Native iOS/Android) (I recommend
it) Urql (React) From Formiddable Labs Relay modern From Facebook
Backend Languages JS/TypeScript Apollo Server Go gqlgen PHP graphql-php Ready
to use (JAMstack) GraphCMS Prime Strapi And many more
GraphQL basics 1. The schema language 2. Queries 3. Mutations
4. Resolvers 5. Dataloaders
Schema type Meetupee { id: ID! name: String! friends: [Meetupee!]!
} type Query { allMeetupees: [Meetupee!] } type Mutation { renameMeetupee(id: ID!, newName: String!) Meetupee! } schema { query: Query, mutation: Mutation }
Queries { query { allMeetupees { name friends { name
} } } }
Mutations Changes to data are called mutations. Idiomatic to return
the object changed. mutation CreateReviewForEpisode($ep: Episode!, $review: ReviewInput!) { createReview(episode: $ep, review: $review) { stars commentary } }
Resolver Knows how to get data for a certain type.
From database From external API From memory GraphQL doesn't care
Dataloaders Batching and caching. Optional. But look it up before
production.
Learn more www.graphql.org
Do I have to replace my API now? No
Questions?
Thanks for your time! If you want to know more,
come find me after the talk.