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
5分で分かった気になれるGraphQLの話
Search
starling888888
November 23, 2019
Programming
1
370
5分で分かった気になれるGraphQLの話
2019-11-23 に行われたDevfest in 信州2019 のLTで発表したスライド
starling888888
November 23, 2019
Tweet
Share
More Decks by starling888888
See All by starling888888
明日から使おうGitLab入門
ryouehara
0
860
Other Decks in Programming
See All in Programming
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.1k
Go1.25からのGOMAXPROCS
kuro_kurorrr
1
810
Node-RED を(HTTP で)つなげる MCP サーバーを作ってみた
highu
0
100
datadog dash 2025 LLM observability for reliability and stability
ivry_presentationmaterials
0
120
PicoRuby on Rails
makicamel
2
110
LINEヤフー データグループ紹介
lycorp_recruit_jp
0
1k
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
Webの外へ飛び出せ NativePHPが切り拓くPHPの未来
takuyakatsusa
2
440
GoのGenericsによるslice操作との付き合い方
syumai
3
690
エンジニア向け採用ピッチ資料
inusan
0
160
ニーリーにおけるプロダクトエンジニア
nealle
0
580
AIコーディング道場勉強会#2 君(エンジニア)たちはどう生きるか
misakiotb
1
250
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
4 Signs Your Business is Dying
shpigford
184
22k
How to train your dragon (web standard)
notwaldorf
94
6.1k
Faster Mobile Websites
deanohume
307
31k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
VelocityConf: Rendering Performance Case Studies
addyosmani
330
24k
Why You Should Never Use an ORM
jnunemaker
PRO
57
9.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
930
Being A Developer After 40
akosma
90
590k
It's Worth the Effort
3n
185
28k
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Transcript
5分で分かった気になれる GraphQLの話 2019-11-23 on Devfest in 信州2019
whoami? Ryo Uehara(@starling8+) ▪ 県内某社のWebエンジニア(新米) ▪ DockerとNodeJSがメインスタック ▪ プライベートではUbuntuとHaskellい じってる
▪ アカウントの8の数は使ってるサービス で変わります 2
1 What is GraphQL? 3
What is GraphQL? 4 ▪ ポストRESTAPIとして注目されているWebAPIの規格 ▪ ネストしたリソースやRESTであれば複数のエンドポイ ントへのリクエストを一回のリクエストで取得できる ▪
複雑なエンドポイントやクエリパラメータを定義するこ となく、必要なフィールドのみをクライアントで取得す ることが可能
What is GraphQL? 従来のRESTモデル 5 出典:https://www.sitepoint.com/rest-2-0-graphql/
What is GraphQL? GraphQLモデル 6 出典:https://www.sitepoint.com/rest-2-0-graphql/
2 Basics of GraphQL 7
Basics of GraphQL ~server side~ TypeDefs ▪ 返すオブジェクトやインプット の型を定義 8
Basics of GraphQL ~server side~ TypeDefs ▪ Queryにデータ取得のエンドポ イントを定義 ▪
Mutationにデータ操作のエン ドポイントを定義 9
Basics of GraphQL ~server side~ Resolvers ▪ Query, Mutationのリクエス トハンドラーを実装
10
Basics of GraphQL ~client side~ Query usage ▪ 必要なフィールドを指定して queryを作成
▪ `/graphql`エンドポイントに POSTメソッドでqueryを送信 11
Basics of GraphQL ~client side~ FrameWork ▪ Client FrameWork(Apollo, Relay...)がうまいこと
loading, errorのハンドリン グやキャッシュをやってくれる 12
3 Good DX 13
Good DX ~graphiql~ ドキュメントビューとクエリを試せるGUIが組み込み済み 14
Good DX ~versioning~ ▪ バージョン管理をしないで済む ▫ 新しく型定義を追加すれば良い ▫ 破壊的変更は非推奨 ▫
削除する場合は非推奨項目であることを示すメタデータ を付与して、使われなくなったら削除 15
4 Conclusion 16
Conclusion GraphQLは ▪ かんたん! ▪ はやい! ▪ たのしい! 17
Thanks! Happy coding with GraphQL! You can find me at:
@starling888888 on Twitter 18
出典 画像出典:https://www.sitepoint.com/rest-2-0-graphql/ コード出典:https://github.com/apollographql/fullstack-tutorial 19
CREDITS Special thanks to all the people who made and
released these awesome resources for free: ▪ Presentation template by SlidesCarnival ▪ Photographs by Unsplash 20