Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
GraphQLについての5分間
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Matsuo Obu
February 28, 2018
Programming
840
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
GraphQLについての5分間
GraphQLについて概要のまとめ。「とらのあな オタク×Node.js勉強会」で発表 (2018-02-28)
Matsuo Obu
February 28, 2018
More Decks by Matsuo Obu
See All by Matsuo Obu
Reactの歴史
mqtsuo02
0
1.1k
文学作品「檸檬」をReactで読む
mqtsuo02
1
520
EmotionでReactをstylingすればモテるかもしれない
mqtsuo02
0
650
僕が求めていたのはNext.jsだったんだ
mqtsuo02
0
720
Repro Tech Hands-on : Nuxt.js
mqtsuo02
1
950
ピピピのPWA
mqtsuo02
0
780
Create React App 読解特急
mqtsuo02
0
130
JekyllとBootstrapを使って静的なブログを作ってみたよ
mqtsuo02
0
110
Other Decks in Programming
See All in Programming
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
310
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
120
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
180
AHC070解法紹介
eijirou
0
120
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
160
JPUG勉強会 OSSデータベースの内部構造を理解しよう(第2回)
oga5
0
260
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3k
Intent as Code
shoppingjaws
6
1k
新卒PdEのリアル
ryu1013
1
500
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
150
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
250
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
200
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Designing for Timeless Needs
cassininazir
1
480
4 Signs Your Business is Dying
shpigford
187
23k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
65k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Making Projects Easy
brettharned
120
6.8k
Music & Morning Musume
bryan
48
7.4k
How to train your dragon (web standard)
notwaldorf
97
6.8k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
330
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Transcript
GraphQLについての5分間 @mqtsuo02 February 28, 2018
@mqtsuo02 ( Matsuo Obu ) Webエンジニア ( フリーランス ) 現在
… もっぱらReact 過去 … Ruby, Java 未来 … Angular, Go 仮想通貨投資 DTM ( ボカロP ) ダンスの習い事 勉強会主催
GraphQL知ってる方いますか?
もくじ ➢ GraphQLとは? ➢ RESTとの違い ➢ APIを叩いてみよう ➢ 所感
GraphQLとは?
GraphQLとは? ➢ Facebookが作ったAPIのインタフェース仕様 http://graphql.org/
GraphQLとは? ➢ OSSとしてGraphQLを導入するための ライブラリが提供されている - C# / .NET - Go
- Java / Android - JavaScript - Swift / Objective-C iOS - Python - C# / .NET - Clojure - Elixir - Erlang - Go - Groovy - Java - JavaScript - PHP - Python - Scala - Ruby Client側 Server側 ➔ ReactはRelay という専用ライブラリがある
GitHubの開発者用ページではGraphQLが主流っぽくなってる https://developer.github.com/ ➢ GitHubがGraphQLでAPIを実装したことが話題に GraphQLとは? API v4 がGraphQL ( API
v3 がREST )
RESTとの違い
• 「リソースの完全なビューを集約するために、2〜3回の別々のリクエ ストが必要になることがありました。私たちのレスポンスは同時に多く のデータを送信し、利用者が必要とするデータは含まれていなかった ようです。」 「RESTは完全でなく、いくつかの欠点があります」 RESTとの違い GraphQLでAPIを実装した背景 ( githubengineering.comより
) • APIの改善要求 エンドポイントに関するメタ情報収集、ページネーションの改善、リク エストパラメータの型安全化、コードからドキュメントの自動生成な ど...
RESTとの違い GraphQLはAPIのためのクエリ言語でありランタイム ➔ RESTでは ... ➔ GraphQLでは ... • リソース毎に複数のエンドポイントに対してリクエストを送る
• サーバは設計したフォーマットを返すように実装する • 1つのエンドポイントに対して必要な情報をクエリとして定義する • サーバはクエリに応じて動的なレスポンスを返す ★ 必要な情報だけを1回のリクエストでまとめて取得できる
RESTとの違い GraphQLはAPIのためのクエリ言語でありランタイム ➢ スキーマを定義しといて ➢ 予測したデータが返る ➢ クエリを投げれば
APIを叩いてみよう
APIを叩いてみよう GitHubアカウントがあればすぐ使える https://developer.github.com/v4/explorer/
APIを叩いてみよう GitHubアカウントがあればすぐ使える https://developer.github.com/v4/explorer/ ドキュメント見ながらクエリ作り ➢ queryは取得系 ➢ mutationは更新系
所感
• API設計に対するフロントvsバックの争いが少なくなる のではないかと思う 所感 • 導入事例がまだ少ないため、案件に導入するにはリス クが高いなと思う • フロントもバックも両方実装が必要であるため、チーム でやる場合は全体でキャッチアップが必要
★ Facebook信者は何も考えず導入しよう!
参考リンク ➢ GraqhQL 公式 ➢ GitHub Engineering ( GraqhQL 導入について
) ➢ GitHub Developer ( GraphQL API ) https://githubengineering.com/the-github-graphql-api/ http://graphql.org/ https://developer.github.com/v4/ ➢ GitHub Developer ( GraphQL API / クエリ検証 ) https://developer.github.com/v4/explorer
ありがとうございました