Submit Search
Upload
REST API に疲れたあなたへ贈る GraphQL 入門
•
30 likes
•
33,561 views
Keisuke Tsukagoshi
Follow
JJUG CCC 2018 Spring #jjug #jjug_ccc #ccc_e6
Read less
Read more
Technology
Report
Share
Report
Share
1 of 55
Download now
Download to read offline
Recommended
レガシーコードに向き合ってみた話
レガシーコードに向き合ってみた話
株式会社MonotaRO Tech Team
マイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチ
増田 亨
Elasticsearch の検索精度のチューニング 〜テストを作って高速かつ安全に〜
Elasticsearch の検索精度のチューニング 〜テストを作って高速かつ安全に〜
Takahiko Ito
MLOps入門
MLOps入門
Hiro Mura
イケてない開発チームがイケてる開発を始めようとする軌跡
イケてない開発チームがイケてる開発を始めようとする軌跡
NTT Communications Technology Development
なぜ、いま リレーショナルモデルなのか(理論から学ぶデータベース実践入門読書会スペシャル)
なぜ、いま リレーショナルモデルなのか(理論から学ぶデータベース実践入門読書会スペシャル)
Mikiya Okuno
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
Takuto Wada
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)
Takuto Wada
Recommended
レガシーコードに向き合ってみた話
レガシーコードに向き合ってみた話
株式会社MonotaRO Tech Team
マイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチ
増田 亨
Elasticsearch の検索精度のチューニング 〜テストを作って高速かつ安全に〜
Elasticsearch の検索精度のチューニング 〜テストを作って高速かつ安全に〜
Takahiko Ito
MLOps入門
MLOps入門
Hiro Mura
イケてない開発チームがイケてる開発を始めようとする軌跡
イケてない開発チームがイケてる開発を始めようとする軌跡
NTT Communications Technology Development
なぜ、いま リレーショナルモデルなのか(理論から学ぶデータベース実践入門読書会スペシャル)
なぜ、いま リレーショナルモデルなのか(理論から学ぶデータベース実践入門読書会スペシャル)
Mikiya Okuno
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
SQLアンチパターン 幻の第26章「とりあえず削除フラグ」
Takuto Wada
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)
SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)
Takuto Wada
全力解説!Transformer
全力解説!Transformer
Arithmer Inc.
ゼロから始める自然言語処理 【FIT2016チュートリアル】
ゼロから始める自然言語処理 【FIT2016チュートリアル】
Yuki Arase
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
NTT DATA Technology & Innovation
エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織
Takafumi ONAKA
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
Yahoo!デベロッパーネットワーク
マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!
mosa siru
シリコンバレーの「何が」凄いのか
シリコンバレーの「何が」凄いのか
Atsushi Nakada
AWSではじめるMLOps
AWSではじめるMLOps
MariOhbuchi
Webアプリを並行開発する際のマイグレーション戦略
Webアプリを並行開発する際のマイグレーション戦略
Takayuki Shimizukawa
先駆者に学ぶ MLOpsの実際
先駆者に学ぶ MLOpsの実際
Tetsutaro Watanabe
Pythonによる黒魔術入門
Pythonによる黒魔術入門
大樹 小倉
QAアーキテクチャの設計による説明責任の高いテスト・品質保証
QAアーキテクチャの設計による説明責任の高いテスト・品質保証
Yasuharu Nishi
何となく勉強した気分になれるパーサ入門
何となく勉強した気分になれるパーサ入門
masayoshi takahashi
最近のKaggleに学ぶテーブルデータの特徴量エンジニアリング
最近のKaggleに学ぶテーブルデータの特徴量エンジニアリング
mlm_kansai
MQTTとAMQPと.NET
MQTTとAMQPと.NET
terurou
SolrとElasticsearchを比べてみよう
SolrとElasticsearchを比べてみよう
Shinsuke Sugaya
Transformerを多層にする際の勾配消失問題と解決法について
Transformerを多層にする際の勾配消失問題と解決法について
Sho Takase
テスト文字列に「うんこ」と入れるな
テスト文字列に「うんこ」と入れるな
Kentaro Matsui
Machine learning CI/CD with OSS
Machine learning CI/CD with OSS
yusuke shibui
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
GraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
Nikolas Burk
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB
More Related Content
What's hot
全力解説!Transformer
全力解説!Transformer
Arithmer Inc.
ゼロから始める自然言語処理 【FIT2016チュートリアル】
ゼロから始める自然言語処理 【FIT2016チュートリアル】
Yuki Arase
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
NTT DATA Technology & Innovation
エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織
Takafumi ONAKA
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
Yahoo!デベロッパーネットワーク
マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!
mosa siru
シリコンバレーの「何が」凄いのか
シリコンバレーの「何が」凄いのか
Atsushi Nakada
AWSではじめるMLOps
AWSではじめるMLOps
MariOhbuchi
Webアプリを並行開発する際のマイグレーション戦略
Webアプリを並行開発する際のマイグレーション戦略
Takayuki Shimizukawa
先駆者に学ぶ MLOpsの実際
先駆者に学ぶ MLOpsの実際
Tetsutaro Watanabe
Pythonによる黒魔術入門
Pythonによる黒魔術入門
大樹 小倉
QAアーキテクチャの設計による説明責任の高いテスト・品質保証
QAアーキテクチャの設計による説明責任の高いテスト・品質保証
Yasuharu Nishi
何となく勉強した気分になれるパーサ入門
何となく勉強した気分になれるパーサ入門
masayoshi takahashi
最近のKaggleに学ぶテーブルデータの特徴量エンジニアリング
最近のKaggleに学ぶテーブルデータの特徴量エンジニアリング
mlm_kansai
MQTTとAMQPと.NET
MQTTとAMQPと.NET
terurou
SolrとElasticsearchを比べてみよう
SolrとElasticsearchを比べてみよう
Shinsuke Sugaya
Transformerを多層にする際の勾配消失問題と解決法について
Transformerを多層にする際の勾配消失問題と解決法について
Sho Takase
テスト文字列に「うんこ」と入れるな
テスト文字列に「うんこ」と入れるな
Kentaro Matsui
Machine learning CI/CD with OSS
Machine learning CI/CD with OSS
yusuke shibui
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
What's hot
(20)
全力解説!Transformer
全力解説!Transformer
ゼロから始める自然言語処理 【FIT2016チュートリアル】
ゼロから始める自然言語処理 【FIT2016チュートリアル】
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
入門 Kubeflow ~Kubernetesで機械学習をはじめるために~ (NTT Tech Conference #4 講演資料)
エンジニアの個人ブランディングと技術組織
エンジニアの個人ブランディングと技術組織
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
At least onceってぶっちゃけ問題の先送りだったよね #kafkajp
マイクロにしすぎた結果がこれだよ!
マイクロにしすぎた結果がこれだよ!
シリコンバレーの「何が」凄いのか
シリコンバレーの「何が」凄いのか
AWSではじめるMLOps
AWSではじめるMLOps
Webアプリを並行開発する際のマイグレーション戦略
Webアプリを並行開発する際のマイグレーション戦略
先駆者に学ぶ MLOpsの実際
先駆者に学ぶ MLOpsの実際
Pythonによる黒魔術入門
Pythonによる黒魔術入門
QAアーキテクチャの設計による説明責任の高いテスト・品質保証
QAアーキテクチャの設計による説明責任の高いテスト・品質保証
何となく勉強した気分になれるパーサ入門
何となく勉強した気分になれるパーサ入門
最近のKaggleに学ぶテーブルデータの特徴量エンジニアリング
最近のKaggleに学ぶテーブルデータの特徴量エンジニアリング
MQTTとAMQPと.NET
MQTTとAMQPと.NET
SolrとElasticsearchを比べてみよう
SolrとElasticsearchを比べてみよう
Transformerを多層にする際の勾配消失問題と解決法について
Transformerを多層にする際の勾配消失問題と解決法について
テスト文字列に「うんこ」と入れるな
テスト文字列に「うんこ」と入れるな
Machine learning CI/CD with OSS
Machine learning CI/CD with OSS
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
Similar to REST API に疲れたあなたへ贈る GraphQL 入門
GraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
Nikolas Burk
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB
Graphql usage
Graphql usage
Valentin Buryakov
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
MarcinStachniuk
VBA API for scriptDB primer
VBA API for scriptDB primer
Bruce McPherson
AppSync and GraphQL on iOS
AppSync and GraphQL on iOS
Amazon Web Services
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
VMware Tanzu
Choisir entre une API RPC, SOAP, REST, GraphQL? Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? Et si le problème était ai...
François-Guillaume Ribreau
APIdays Paris 2018 - Building scalable, type-safe GraphQL servers from scratc...
APIdays Paris 2018 - Building scalable, type-safe GraphQL servers from scratc...
apidays
SETCON'18 - Ilya labacheuski - GraphQL adventures
SETCON'18 - Ilya labacheuski - GraphQL adventures
Nadzeya Pus
Introduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOS
Amazon Web Services
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Nikolas Burk
GraphQL - an elegant weapon... for more civilized age
GraphQL - an elegant weapon... for more civilized age
Bartosz Sypytkowski
GraphQL the holy contract between client and server
GraphQL the holy contract between client and server
Pavel Chertorogov
Introduction To Groovy 2005
Introduction To Groovy 2005
Tugdual Grall
Overview of GraphQL & Clients
Overview of GraphQL & Clients
Pokai Chang
Node.js: scalability tips - Azure Dev Community Vijayawada
Node.js: scalability tips - Azure Dev Community Vijayawada
Luciano Mammino
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
Amazon Web Services
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
Amazon Web Services
Similar to REST API に疲れたあなたへ贈る GraphQL 入門
(20)
GraphQL & Prisma from Scratch
GraphQL & Prisma from Scratch
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
MongoDB.local Berlin: Building a GraphQL API with MongoDB, Prisma and Typescript
Graphql usage
Graphql usage
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
VBA API for scriptDB primer
VBA API for scriptDB primer
AppSync and GraphQL on iOS
AppSync and GraphQL on iOS
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Choisir entre une API RPC, SOAP, REST, GraphQL? Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? Et si le problème était ai...
APIdays Paris 2018 - Building scalable, type-safe GraphQL servers from scratc...
APIdays Paris 2018 - Building scalable, type-safe GraphQL servers from scratc...
SETCON'18 - Ilya labacheuski - GraphQL adventures
SETCON'18 - Ilya labacheuski - GraphQL adventures
Introduction to GraphQL and AWS Appsync on AWS - iOS
Introduction to GraphQL and AWS Appsync on AWS - iOS
Managing GraphQL servers with AWS Fargate & Prisma Cloud
Managing GraphQL servers with AWS Fargate & Prisma Cloud
GraphQL - an elegant weapon... for more civilized age
GraphQL - an elegant weapon... for more civilized age
GraphQL the holy contract between client and server
GraphQL the holy contract between client and server
Introduction To Groovy 2005
Introduction To Groovy 2005
Overview of GraphQL & Clients
Overview of GraphQL & Clients
Node.js: scalability tips - Azure Dev Community Vijayawada
Node.js: scalability tips - Azure Dev Community Vijayawada
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
NEW LAUNCH! Realtime and Offline application development using GraphQL with A...
Recently uploaded
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
IES VE
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Zilliz
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Zilliz
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
WSO2
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
Samir Dash
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
Kumar Satyam
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Christopher Logan Kennedy
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
johnbeverley2021
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Juan lago vázquez
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Orbitshub
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Deepika Singh
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Remote DBA Services
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Orbitshub
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
WSO2
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard37
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Recently uploaded
(20)
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
REST API に疲れたあなたへ贈る GraphQL 入門
1.
Amazon Web Services
Japan Tsukagoshi Keisuke REST API GraphQL JJUG CCC 2018 Spring #ccc_e6
2.
Who am I
? e gd B A @ Mobile / DevOps / Serverless W SJ ba W J c S=
3.
Overview c G E E
R Q Aa A G I G I G S T Q LPR I We G
4.
GraphQL
5.
GraphQL ? • GraphQL
API TypeSystem • GraphQL
6.
GraphQL -REST API
- • REST API • API • API • API • • API • Request / Response
7.
GraphQL • , • • API •
API
8.
GraphQL – GraphQL
- • P ) A • A ) B A C • A I B A P )
9.
GraphQL – GraphQL
- • P ) A • A ) B A C • A I B A P )
10.
! type Todo { id:
ID! name: String description: String status: TodoStatus } type Query { getTodos: [Todo] } enum TodoStatus { done pending } A N I S D )
11.
)
12.
)
13.
) ) PL • La
G p - G PL G P hp r I C P P • I C P P G B - P G QI • I A QG P I -I G
14.
) { "id": "1", "name": "Get
Milk", “priority": "1" }, { "id": “2", "name": “Go to gym", “priority": “5" },… type Query { getTodos: [Todo] } type Todo { id: ID! name: String description: String priority: Int duedate: String } query { getTodos { id name priority } }
15.
) != Graph database NoSQL,
Relational, HTTP, etc. GraphQL /posts /postInfo /postJustTitle /postsByAuthor /postNameStartsWithX /commentsOnPost
16.
) ) PL • La
G p - G PL G P hp r I C P P • I C P P G B - P G QI • I A QG P I -I G
17.
) Mutation - mutation addPost( id:123 title:”New
post!” author:”Nadia”){ id title author } data: [{ id:123, title:”New Post!” author:”Nadia” }]
18.
type Subscription { addedPost:
Post @aws_subscribe(mutations: ["addPost"]) deletedPost: Post @aws_subscribe(mutations: ["deletePost"]) } type Mutation { addPost(id: ID! author: String! title: String content: String): Post! deletePost(id: ID!): Post! } subscription NewPostSub { addedPost { __typename version title content author url } }
19.
) ) Subscription NewPostSub
{ addedPost{…} } WebSocket URL and Connection Payload Secure Websocket Connection (wss://)
20.
const AllPostsWithData =
compose( graphql(AllPostsQuery, { options: { fetchPolicy: 'cache-and-network‘ }, props: (props) => ({ posts: props.data.posts, subscribeToNewPosts: params => { props.data.subscribeToMore({ document: NewPostsSubscription, updateQuery: (prev, { subscriptionData: { newPost } }) => ({ ...prev, posts: [newPost, ...prev.posts.filter(post => post.id !== newPost.id)] }) }); }); …//more code )
21.
Demo:
22.
AppSync
23.
AWS AppSync GraphQL GraphQL
24.
• • • • • • • • • • Sync
25.
AppSync • • • • • • •
26.
AppSync Overview AWS AppSync Amazon DynamoDB AWS Lambda ElasticSearch
27.
dynamoDB AmazonES Amazon DynamoDB ElasticSearch e.t.c
28.
Lambda 3rdPartyAPI Lambda DataSource WebAPI
29.
30.
31.
32.
AWS AppSync Amazon DynamoDB AWS Lambda ElasticSearch
33.
• • GraphQL API
1 GraphQL SDL(Schema Definition Language)
34.
schema { query:Query mutation: Mutation subscription:
Subscription } Query : Mutation : Subscription :
35.
type Query { getTodos:
[Todo] } type Todo { id: ID! name: String description: String status: TodoStatus } enum TodoStatus { done pending } Not Null ID! [String!]
36.
Resolver Mapping Template
37.
AppSync Overview AWS AppSync Amazon DynamoDB AWS Lambda ElasticSearch
38.
• GraphQL GraphQL • Apache
Velocity Template Language VTL • • https://docs.aws.amazon.com/appsync/latest/devguide/resolver- mapping-template-reference-programming-guide.html
39.
• • • • • • ID / •
40.
• •
41.
: { "version" : "2017-02-28", "operation"
: "GetItem", "key" : { "id" : { "S" : "${context.arguments.id}" } } }
42.
: $utils.toJson($context.result) { "id" : ${context.data.id}, "title"
: "${context.data.theTitle}", "content" : "${context.data.body1} ${context.data.body2}" }
43.
44.
DynamoDB
45.
46.
AppSync Overview AWS AppSync Amazon DynamoDB AWS Lambda ElasticSearch
47.
GraphQL Endpoint export default
{ "graphqlEndpoint": "https://**.appsync-api.**.amazonaws.com/graphql", "region": "us-east-1", "authenticationType": "API_KEY", "apiKey": ”***" }
48.
Client const client =
new AWSAppSyncClient({ url: awsconfig.ENDPOINT, region: AWS.config.region, auth: { type: AUTH_TYPE.AWS_IAM, credentials: Auth.currentCredentials() } }); const WithProvider = () => ( <ApolloProvider client={client}> <Rehydrated> <AppWithData /> </Rehydrated> </ApolloProvider> ); https://aws.github.io/aws-amplify/
49.
Client //API Key const client
= new AWSAppSyncClient({ url: awsconfig.ENDPOINT, region: awsconfig.REGION, auth: { type: AUTH_TYPE.API_KEY, apiKey: awsconfig.apiKey} });
50.
Client //IAM auth: { type:
AUTH_TYPE.AWS_IAM, credentials: Auth.currentCredentials() } //Cognito User Pool auth: { type: AUTH_TYPE.AMAZON_COGNITO_USER_POOLS, jwtToken: Auth.currentSession().accessToke.jwtToken }
51.
Demo: GraphQL
52.
• AWS AppSync
GraphQL Photo Sample • https://github.com/aws-samples/aws-amplify-graphql • GraphQL starter application • https://github.com/aws-samples/aws-mobile-appsync- events-starter-react
53.
AWS AppSync GraphQL
Photo Sample
54.
B • B B ) C •
C ) A I I P C • C P C P P )
55.
Happy coding with
AppSync! AWS AppSync Amazon DynamoDB AWS Lambda ElasticSearch AWS AppSync GraphQL API
Download now