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
Efficient development with GraphQL
Search
murajun1978
October 13, 2019
Programming
0
290
Efficient development with GraphQL
My talk at GraphQL Osaka 2019
murajun1978
October 13, 2019
Tweet
Share
More Decks by murajun1978
See All by murajun1978
Building Tebukuro with Hotwire and Rails
murajun1978
0
1.2k
Zeitwerk integration in Rails 6.0
murajun1978
0
100
Effective Debugging Apps in VS Code
murajun1978
1
880
tebukuro
murajun1978
0
110
Shinosaka.rb #17 Hands on
murajun1978
0
43
New Features in Rails 4.2
murajun1978
0
900
shinosakarb #11 Rails 4 Pattenrs
murajun1978
1
120
FactoryGirl LT
murajun1978
1
66
Shinosaka.rb #3
murajun1978
0
51
Other Decks in Programming
See All in Programming
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
230
QA環境で誰でも自由自在に現在時刻を操って検証できるようにした話
kalibora
1
110
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
390
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
220
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
240
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
190
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
290
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
250
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
6
1.3k
週次リリースを実現するための グローバルアプリ開発
tera_ny
1
690
선언형 UI에서의 상태관리
l2hyunwoo
0
250
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
500
Featured
See All Featured
KATA
mclloyd
29
14k
Raft: Consensus for Rubyists
vanstee
137
6.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
VelocityConf: Rendering Performance Case Studies
addyosmani
327
24k
Docker and Python
trallard
43
3.2k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Site-Speed That Sticks
csswizardry
2
220
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
97
17k
Faster Mobile Websites
deanohume
305
30k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Transcript
Efficient development with GraphQL GraphQL Osaka 2019
{ me: { name, avatar, jobs, communities } } {
me: { name: “murajun1978”, avatar: , jobs: [“Web developer”], communties: [ “Shinosaka.rb”, “Rails Follow-up Osaka”, “Osaka Web Developers Meetup”, “Open Source Software Developers Osaka” ] } }
リーンソフトウェア開発 • ムダを排除する • 知識を作り出す • 決定をできるだけ遅らせる • できるだけ早く提供する •
チームに権限を移譲する • 全体を最適化する • 品質を作り込む
いかに効率よく最速で かつ 必要最低限のコストで 高品質なアプリケーションを 継続的に開発できるのか
ムダを排除する
アプリケーションを開発するたびに フロントエンドで バックエンドAPIのClientを作る
まじめんどくさいし コストもかかる
Apollo GraphQL
Apollo Server • GraphQL.jsベースのGraphQL Server • Web Frameworkに対応 ◦ Express
◦ Koa ◦ Hapi ◦ Hastify ◦ Amazon Lambda ◦ Micro ◦ Azure Functions ◦ Google Cloud Functions • OSS
Apollo Server Demo
アプリケーションを開発するたびに フロントエンドで バックエンドAPIのClientを作る
GraphQL Code Generator https://graphql-code-generator.com/
GraphQL Code Generator • GraphQLのschemaから型定義やクライアント用のコードを生成 • ResolverのTypeScript型定義 • React Apolloのコード生成
• 他にもpluginがある ◦ https://graphql-code-generator.com/docs/plugins/
GraphQL Code Generator Demo
できるだけ早く提供する
バックエンドの開発が終わるまで フロントエンドの開発に着手できない もしくは できるけど手戻りがあったりする
Mocking
Apollo Server Mocking • Apollo Serverをモックサーバにできる • 実装が終わったResolverを順次適用していくことができる
Apollo Server Mocking Demo
品質を作り込む ✨
Apollo Server Integration Testing • 結合テスト用のクライアントを提供 • Jestのスナップショットを使って、Apollo Serverの振る舞いをテストする
Apollo Server Integration Testing Demo
開発初期は資金も不足がち 最低限のインフラコストで運用したい
Apollo Serverは関係ない?
Apollo ServerはServerlessとお友達です
Google Cloud Functions
Google Cloud Functions • Googleのサーバレスコンピューティング • 毎月無料枠があって、お金がないプロジェクトにはやさしい料金体系 • Node.js v8,
v10 (beta) 環境で実行できる • Firebase Toolsで簡単デプロイ
Firebase Hosting
Firebase Hosting • Googleのホスティングサービス • CloudflareなどのCDNに配信できる • Firebase Toolsで簡単デプロイ
まとめ • GraphQL Code Generatorで型定義、クライアントコードを自動生成してくれるの で、めんどうな実装やコストを削減できる • 開発初期はモックサーバとして活用し、実装が終わったResolverを適用していくこ とができるので、フロントエンドとバックエンドが同時に開発できる •
フロントエンド、バックエンドともTypeScriptでかけるので、学習コストを抑えることが できる • Serverlessで動作可能なので、インフラコストも削減できる • 運用面でもServerlessはメリット大です
Thank you