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
870
Other Decks in Programming
See All in Programming
抽象化という思考のツール - 理解と活用 - / Abstraction-as-a-Tool-for-Thinking
shin1x1
1
950
CLI ツールを Go ライブラリ として再実装する理由 / Why reimplement a CLI tool as a Go library
ktr_0731
3
1k
Vibe Codingの幻想を超えて-生成AIを現場で使えるようにするまでの泥臭い話.ai
fumiyakume
21
10k
WebAssemblyインタプリタを書く ~Component Modelを添えて~
ruccho
1
720
DataformでPythonする / dataform-de-python
snhryt
0
160
AI Ramen Fight
yusukebe
0
130
Webinar: AI-Powered Development: Transformiere deinen Workflow mit Coding Tools und MCP Servern
danielsogl
0
100
DynamoDBは怖くない!〜テーブル設計の勘所とテスト戦略〜
hyamazaki
0
200
Claude Code で Astro blog を Pages から Workers へ移行してみた
codehex
0
180
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
360
Comparing decimals in Swift Testing
417_72ki
0
170
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
9
1.8k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.3k
Practical Orchestrator
shlominoach
190
11k
A Modern Web Designer's Workflow
chriscoyier
695
190k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Rails Girls Zürich Keynote
gr2m
95
14k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
19k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3.1k
Music & Morning Musume
bryan
46
6.7k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
440
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
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