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
200
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React+Graphqlで快適スキーマ駆動開発
React+Graphqlの開発体験がすごくいいので、皆さんも試してみてください。
takuma.n
June 04, 2023
More Decks by takuma.n
See All by takuma.n
現場に寄り添い、価値を届けるチーム開発プロセス
takumamiyazawa
0
1.4k
プロダクトエンジニア一年生のしくじり 〜フリーランスがプロダクトエンジニアになるまで〜
takumamiyazawa
0
980
Other Decks in Programming
See All in Programming
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
100
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
120
【やさしく解説 設計編・中級 #1】一つの車に、運転手は一人 ~ある倉庫システムの事例から~
panda728
PRO
0
180
地域 SRE コミュニティ最前線 - ホンマでっかSRE勉強会
tk3fftk
0
240
関数型プログラミングのメリットって何だろう?
wanko_it
0
180
5分で問診!Composer セキュリティ健康診断
codmoninc
0
330
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
170
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
500
Foundation Models frameworkで画像分析
ryodeveloper
1
120
OSINT for SRE: 学術論文とポストモーテムから探る システム障害の共通パターン / SRE NEXT 2026
tomoyk
1
3.8k
「正の参照」と 「負の導出」で組む ハーネスエンジニアリング
cottpan
1
140
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
Featured
See All Featured
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Mobile First: as difficult as doing things right
swwweet
225
10k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.7k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
410
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
310
The Invisible Side of Design
smashingmag
301
52k
Designing Experiences People Love
moore
143
24k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
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
モックサーバー