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
390
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
5分で分かった気になれるGraphQLの話
2019-11-23 に行われたDevfest in 信州2019 のLTで発表したスライド
starling888888
November 23, 2019
More Decks by starling888888
See All by starling888888
明日から使おうGitLab入門
ryouehara
0
1k
Other Decks in Programming
See All in Programming
Flow は今どうなっているか
mizdra
PRO
0
670
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
360
VibeCodingからAgenticWorkflowへ
starfish719
0
750
Oxlintはいいぞ(続)
yug1224
1
360
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
390
バグを直したら useEffect が消えた
colorful12
3
680
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
4
960
React本体のコードリーディング
high_g_engineer
1
150
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
270
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.1k
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
12
19k
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
230
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
Un-Boring Meetings
codingconduct
0
390
Designing Experiences People Love
moore
143
24k
Chasing Engaging Ingredients in Design
codingconduct
0
280
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
360
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
440
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
390
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
620
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
250
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