SlideShare uma empresa Scribd logo
1 de 19
Baixar para ler offline
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
ありがとうございました

Mais conteúdo relacionado

Mais procurados

Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
confluent
 

Mais procurados (20)

Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
Synchronous Commands over Apache Kafka (Neil Buesing, Object Partners, Inc) K...
 
PHPでマルチスレッド
PHPでマルチスレッドPHPでマルチスレッド
PHPでマルチスレッド
 
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
Apache Calcite: A Foundational Framework for Optimized Query Processing Over ...
 
Solid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven DesignSolid principles, Design Patterns, and Domain Driven Design
Solid principles, Design Patterns, and Domain Driven Design
 
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUGMicroservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
Microservices Tracing With Spring Cloud and Zipkin @Szczecin JUG
 
Evening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in FlinkEvening out the uneven: dealing with skew in Flink
Evening out the uneven: dealing with skew in Flink
 
Angular and The Case for RxJS
Angular and The Case for RxJSAngular and The Case for RxJS
Angular and The Case for RxJS
 
Ruby Rails 老司機帶飛
Ruby Rails 老司機帶飛Ruby Rails 老司機帶飛
Ruby Rails 老司機帶飛
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテスト
 
Airflow at WePay
Airflow at WePayAirflow at WePay
Airflow at WePay
 
Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)Exploring Java Heap Dumps (Oracle Code One 2018)
Exploring Java Heap Dumps (Oracle Code One 2018)
 
Apache Airflow
Apache AirflowApache Airflow
Apache Airflow
 
Taylor Wicksell and Tom Gianos at SpringOne Platform 2019
Taylor Wicksell and Tom Gianos at SpringOne Platform 2019Taylor Wicksell and Tom Gianos at SpringOne Platform 2019
Taylor Wicksell and Tom Gianos at SpringOne Platform 2019
 
Introducing Apache Airflow and how we are using it
Introducing Apache Airflow and how we are using itIntroducing Apache Airflow and how we are using it
Introducing Apache Airflow and how we are using it
 
Action Jackson! Effective JSON processing in Spring Boot Applications
Action Jackson! Effective JSON processing in Spring Boot ApplicationsAction Jackson! Effective JSON processing in Spring Boot Applications
Action Jackson! Effective JSON processing in Spring Boot Applications
 
A Deep Dive into Kafka Controller
A Deep Dive into Kafka ControllerA Deep Dive into Kafka Controller
A Deep Dive into Kafka Controller
 
XStream: stream processing platform at facebook
XStream:  stream processing platform at facebookXStream:  stream processing platform at facebook
XStream: stream processing platform at facebook
 
Iceberg: a fast table format for S3
Iceberg: a fast table format for S3Iceberg: a fast table format for S3
Iceberg: a fast table format for S3
 
CDC Stream Processing with Apache Flink
CDC Stream Processing with Apache FlinkCDC Stream Processing with Apache Flink
CDC Stream Processing with Apache Flink
 
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow management
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow managementIntro to Airflow: Goodbye Cron, Welcome scheduled workflow management
Intro to Airflow: Goodbye Cron, Welcome scheduled workflow management
 

Semelhante a GraphQLについての5分間

ROS JAPAN Users Group Meetup 03
ROS JAPAN Users Group Meetup 03ROS JAPAN Users Group Meetup 03
ROS JAPAN Users Group Meetup 03
Daiki Maekawa
 
なぜ初心者は webpackが解らないのか?- Why can’t you understand the webpack? -
なぜ初心者は webpackが解らないのか?- Why can’t you understand the webpack? - なぜ初心者は webpackが解らないのか?- Why can’t you understand the webpack? -
なぜ初心者は webpackが解らないのか?- Why can’t you understand the webpack? -
健人 井関
 

Semelhante a GraphQLについての5分間 (20)

グラフモデルとSoEとGraphQL データ指向アプリケーションデザインから見るGraphQL
グラフモデルとSoEとGraphQL データ指向アプリケーションデザインから見るGraphQLグラフモデルとSoEとGraphQL データ指向アプリケーションデザインから見るGraphQL
グラフモデルとSoEとGraphQL データ指向アプリケーションデザインから見るGraphQL
 
GraphQL入門+診断観点
GraphQL入門+診断観点GraphQL入門+診断観点
GraphQL入門+診断観点
 
全部入り!WGPで高速JavaScript+HML5体験
全部入り!WGPで高速JavaScript+HML5体験全部入り!WGPで高速JavaScript+HML5体験
全部入り!WGPで高速JavaScript+HML5体験
 
普段Reactを触ってる僕が Angularを触ってみた感想を共有する
普段Reactを触ってる僕が Angularを触ってみた感想を共有する普段Reactを触ってる僕が Angularを触ってみた感想を共有する
普段Reactを触ってる僕が Angularを触ってみた感想を共有する
 
Java クライント実装におけるAPIスタイル頂上決戦! 野良REST vs GraphQL vs OData vs OpenAPI (Swagger)
Java クライント実装におけるAPIスタイル頂上決戦! 野良REST vs GraphQL vs OData vs OpenAPI (Swagger)Java クライント実装におけるAPIスタイル頂上決戦! 野良REST vs GraphQL vs OData vs OpenAPI (Swagger)
Java クライント実装におけるAPIスタイル頂上決戦! 野良REST vs GraphQL vs OData vs OpenAPI (Swagger)
 
いまさら触るAwt
いまさら触るAwtいまさら触るAwt
いまさら触るAwt
 
SwaggerとAPIのデザイン
SwaggerとAPIのデザインSwaggerとAPIのデザイン
SwaggerとAPIのデザイン
 
Goji とレイヤ化アーキテクチャ
Goji とレイヤ化アーキテクチャGoji とレイヤ化アーキテクチャ
Goji とレイヤ化アーキテクチャ
 
Cloud native & cloud design patterns for small teams - ハッカーズチャンプルー2018
Cloud native & cloud design patterns for  small teams - ハッカーズチャンプルー2018Cloud native & cloud design patterns for  small teams - ハッカーズチャンプルー2018
Cloud native & cloud design patterns for small teams - ハッカーズチャンプルー2018
 
【初心者向け】API を使ってクラウドの管理を自動化しよう
【初心者向け】API を使ってクラウドの管理を自動化しよう【初心者向け】API を使ってクラウドの管理を自動化しよう
【初心者向け】API を使ってクラウドの管理を自動化しよう
 
GraphQL入門
GraphQL入門GraphQL入門
GraphQL入門
 
The History of Reactive Extensions
The History of Reactive ExtensionsThe History of Reactive Extensions
The History of Reactive Extensions
 
REST API、gRPC、GraphQL 触ってみた【2023年12月開催勉強会資料】
REST API、gRPC、GraphQL 触ってみた【2023年12月開催勉強会資料】REST API、gRPC、GraphQL 触ってみた【2023年12月開催勉強会資料】
REST API、gRPC、GraphQL 触ってみた【2023年12月開催勉強会資料】
 
React VR ことはじめ
React VR ことはじめReact VR ことはじめ
React VR ことはじめ
 
オフラインWebアプリの再到来で今、再び注目されるAPIの本命 ーJavaScript SQL-like database
オフラインWebアプリの再到来で今、再び注目されるAPIの本命 ーJavaScript SQL-like databaseオフラインWebアプリの再到来で今、再び注目されるAPIの本命 ーJavaScript SQL-like database
オフラインWebアプリの再到来で今、再び注目されるAPIの本命 ーJavaScript SQL-like database
 
ROS JAPAN Users Group Meetup 03
ROS JAPAN Users Group Meetup 03ROS JAPAN Users Group Meetup 03
ROS JAPAN Users Group Meetup 03
 
RESTからGraphQL APIへの移行で学んだこと.pptx
RESTからGraphQL APIへの移行で学んだこと.pptxRESTからGraphQL APIへの移行で学んだこと.pptx
RESTからGraphQL APIへの移行で学んだこと.pptx
 
なぜ初心者は webpackが解らないのか?- Why can’t you understand the webpack? -
なぜ初心者は webpackが解らないのか?- Why can’t you understand the webpack? - なぜ初心者は webpackが解らないのか?- Why can’t you understand the webpack? -
なぜ初心者は webpackが解らないのか?- Why can’t you understand the webpack? -
 
Scalaでもgae
ScalaでもgaeScalaでもgae
Scalaでもgae
 
GraphQLはどんな時に使うか
GraphQLはどんな時に使うかGraphQLはどんな時に使うか
GraphQLはどんな時に使うか
 

Último

Último (10)

知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 

GraphQLについての5分間