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
300
Efficient development with GraphQL
My talk at GraphQL Osaka 2019
murajun1978
October 13, 2019
Tweet
Share
More Decks by murajun1978
See All by murajun1978
How to Enjoy the Murajun’s Style
murajun1978
0
52
Building Tebukuro with Hotwire and Rails
murajun1978
0
1.3k
Zeitwerk integration in Rails 6.0
murajun1978
0
110
Effective Debugging Apps in VS Code
murajun1978
1
900
tebukuro
murajun1978
0
120
Shinosaka.rb #17 Hands on
murajun1978
0
50
New Features in Rails 4.2
murajun1978
0
920
shinosakarb #11 Rails 4 Pattenrs
murajun1978
1
140
FactoryGirl LT
murajun1978
1
70
Other Decks in Programming
See All in Programming
External SecretsのさくらProvider初期実装を担当しています
logica0419
0
250
技術懸念に立ち向かい 法改正を穏便に乗り切った話
pop_cashew
0
1.1k
TSConfigからTypeScriptの世界を覗く
planck16
2
1.3k
當開發遇上包裝:AI 如何讓產品從想法變成商品
clonn
0
2.8k
Using AI Tools Around Software Development
inouehi
0
170
TypeScript だけを書いて Tauri でデスクトップアプリを作ろう / Tauri with only TypeScript
tris5572
2
550
Perlで痩せる
yuukis
1
670
ワンバイナリWebサービスのススメ
mackee
10
7.6k
Doma で目指す ORM 最適解
nakamura_to
1
170
Efficiency and Rock 'n’ Roll (Really!)
hollycummins
0
650
PT AI без купюр
v0lka
0
210
AI Coding Agent Enablement in TypeScript
yukukotani
17
7.9k
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.8k
Become a Pro
speakerdeck
PRO
28
5.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.4k
Code Reviewing Like a Champion
maltzj
524
40k
Done Done
chrislema
184
16k
How to Think Like a Performance Engineer
csswizardry
24
1.6k
Adopting Sorbet at Scale
ufuk
76
9.4k
How GitHub (no longer) Works
holman
314
140k
Six Lessons from altMBA
skipperchong
28
3.8k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
6
670
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