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
GraphQL DataLoader 적용하기
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
angelxtry
February 08, 2020
Programming
0
99
GraphQL DataLoader 적용하기
angelxtry
February 08, 2020
Tweet
Share
Other Decks in Programming
See All in Programming
CSC307 Lecture 01
javiergs
PRO
0
690
CSC307 Lecture 07
javiergs
PRO
0
550
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.9k
Basic Architectures
denyspoltorak
0
670
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
280
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
190
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
130
AWS re:Invent 2025参加 直前 Seattle-Tacoma Airport(SEA)におけるハードウェア紛失インシデントLT
tetutetu214
2
110
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.1k
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
190
Implementation Patterns
denyspoltorak
0
290
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
6k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Skip the Path - Find Your Career Trail
mkilby
0
56
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.5k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
320
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
1.9k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
75
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Transcript
GraphQL DataLoader 2020.02.08 doit team ࣻഐ https://github.com/angelxtry
TL; DR GraphQLਸ بੑ೮ݶ DataLoaderܳ ਊೞࣁਃ. فߣ ೞࣁਃ.
Teck stack
GraphQL
GraphQL ػ(nested) ࠁܳ োझۣѱ ۽٘ೡ ࣻ .
GraphQL ػ(nested) ࠁܳ োझۣѱ ۽٘ೡ ࣻ .
None
None
GraphQL ػ(nested) ࠁܳ োझۣѱ ۽٘ೡ ࣻ .
None
ޙઁߊࢤ
dummy data 50 user full data
וܻ. ৵? ۽Ӓܳ ࠁ! ۽Ӓܳ!
۽Ӓо ցޖ ݆ই! query query query query query query query
query query query query query query query query query query query query query query
ࠗఠ द! 10 user data + motivations data ઑഥ
۽Ӓܳ ࠁ! ۽Ӓܳ!
য?!?! user * 1 + motivaions * 10 = 11(?)
user * 1 + table 6 * user 50 =
301(!!)
N+1 Problem
users user user user user user Select
users user user user user user m m m m
m Select Select Select Select Select Select
যڌѱ ೧Ѿ೮աਃ?
DataLoader
DataLoader is a generic utility to be used as part
of your application’s data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.
users user user user user user 1 User ప࠶ select
key key key key key DataLoader users user user user
user user 2 DataLoaderী key 1 User ప࠶ select
key key key key key DataLoader val val val val
val users user user user user user Select 3 Motivations table select 2 DataLoaderী key 1 User ప࠶ select
key key key key key DataLoader val val val val
val users user user user user user m m m m m Select 4 User߹ Motivation ೡ 3 Motivations table select 2 DataLoaderী key 1 User ప࠶ select
userSchema.ts
userResolver.ts
DataLoader ਊ!
yarn add dataloader
userResolver.ts
userResolver.ts
userRepository.ts
userRepository.ts
ࢎ೦
ࢎ೦ 1
ࢎ೦ 2
ࢎ೦ 3
ޤо જইաਃ?
Select 2ߣ
500 user full data
Select 2ߣ
Postman 10ഥ ߈ࠂ प೯ റ 10ഥ ಣӐ प೯ ࣘب ஏ
Postman 10ഥ ߈ࠂ प೯ റ 10ഥ ಣӐ प೯ ࣘب ஏ
ਊ : 1318ms ਊ റ: 117ms
Ѿۿ
TL; DR GraphQLਸ بੑ೮ݶ DataLoaderܳ ਊೞࣁਃ. فߣ ೞࣁਃ.
ӟ ߊ ٜয࣊ࢲ хࢎפ! ߊ ղਊਸ ؊ ࠁҊ रਵदݶ? https://blog.doitreviews.com/development/
2020-02-04-graphql-typeorm-dataloader/ ۽ં ٘о ҾӘೞदݶ? https://github.com/codestates/healthFriend-server