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
880
Other Decks in Programming
See All in Programming
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
プロパティベーステストによるUIテスト: LLMによるプロパティ定義生成でエッジケースを捉える
tetta_pdnt
0
4.3k
私の後悔をAWS DMSで解決した話
hiramax
4
210
OSS開発者という働き方
andpad
5
1.7k
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
24
12k
より安全で効率的な Go コードへ: Protocol Buffers Opaque API の導入
shwatanap
2
780
Navigating Dependency Injection with Metro
zacsweers
3
3.5k
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
1
460
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
300
JSONataを使ってみよう Step Functionsが楽しくなる実践テクニック #devio2025
dafujii
1
640
Namespace and Its Future
tagomoris
6
710
Ruby Parser progress report 2025
yui_knk
1
460
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
It's Worth the Effort
3n
187
28k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Practical Orchestrator
shlominoach
190
11k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.2k
Code Reviewing Like a Champion
maltzj
525
40k
Done Done
chrislema
185
16k
How to Ace a Technical Interview
jacobian
279
23k
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