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
React+Graphqlで快適スキーマ駆動開発
Search
takuma.n
June 04, 2023
Programming
0
160
React+Graphqlで快適スキーマ駆動開発
React+Graphqlの開発体験がすごくいいので、皆さんも試してみてください。
takuma.n
June 04, 2023
Tweet
Share
More Decks by takuma.n
See All by takuma.n
プロダクトエンジニア一年生のしくじり 〜フリーランスがプロダクトエンジニアになるまで〜
takumamiyazawa
0
310
Other Decks in Programming
See All in Programming
小さく段階的リリースすることで深夜メンテを回避する
mkmk884
2
150
PHPのガベージコレクションを深掘りしよう
rinchoku
0
260
Kamal 2 – Get Out of the Cloud
aleksandrov
0
140
snacks.nvim内のセットアップ不要なプラグインを紹介 / introduce_snacks_nvim
uhooi
0
370
Windows版PHPのビルド手順とPHP 8.4における変更点
matsuo_atsushi
0
390
Rollupのビルド時間高速化によるプレビュー表示速度改善とバンドラとASTを駆使したプロダクト開発の難しさ
plaidtech
PRO
1
110
家族・子育て重視/沖縄在住を維持しながらエンジニアとしてのキャリアをどのように育てていくか?
ug
0
260
本当だってば!俺もTRICK 2022に入賞してたんだってば!
jinroq
0
270
PHPer's Guide to Daemon Crafting Taming and Summoning
uzulla
2
1.1k
The Weight of Data: Rethinking Cloud-Native Systems for the Age of AI
hollycummins
0
230
国漢文混用体からHolloまで
minhee
1
120
Go1.24 go vetとtestsアナライザ
kuro_kurorrr
2
740
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
102
19k
The Invisible Side of Design
smashingmag
299
50k
4 Signs Your Business is Dying
shpigford
183
22k
Six Lessons from altMBA
skipperchong
27
3.7k
Optimizing for Happiness
mojombo
377
70k
How STYLIGHT went responsive
nonsquared
99
5.4k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
17
1.1k
Transcript
React + Graphqlで 快適スキーマ駆動開発
自己紹介 宮沢 趣味:ラップバトル観戦、ポーカー 基本Typescriptを触ってます
フォローしてね🐣
今日話すこと Graphqlを使ったスキーマ駆動開発の流れと 改善されること Reactとの親和性 一般的なサービス開発の流れと問題点
一般的なサービス開発の 流れと問題点
APIできたら繋ぎこみ APIで受け取る値は ハードコーディング Swaggerなどで API定義書用意 API開発進める サーバーサイド フロントエンド
フロントが後手に回りがち🥲 Swaggerの仕様と 実際のAPIが違くね?🤔 Swagger(yml)書きにくい🤮
Graphqlを使った場合
.graphqlによる API定義書が書きやすい
スキーマ ファイル を定義
.graphqlファイル書く API定義(Swagger) + モックサーバー + 型
モックサーバー
モックサーバーと繋ぐことで フロントはハードコーディン グせずに済む!
フロントとサーバー両方とも Typescriptなら
.graphqlから型生成して その型をAPI側とフロント側 で共有することで 乖離がなくなる
ここからReact絡めたお話
Graphql Code Generater
こいつがすごい
Graphqlの定義ファイル TypeScriptの型 React Hooks + ↓
実際のコードで見てみよう
フォローしてね🐣
https://zenn.dev/tackman/articles/9a49e53315b83d
モックサーバー