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
GraphQLのステキポイントと悩ましいポイント
Search
maru333
October 09, 2019
Programming
0
2.3k
GraphQLのステキポイントと悩ましいポイント
maru333
October 09, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
リリース8年目のサービスの1800個のERBファイルをViewComponentに移行した方法とその結果
katty0324
5
4.1k
Tauriでネイティブアプリを作りたい
tsucchinoko
0
350
役立つログに取り組もう
irof
28
9.3k
イベント駆動で成長して委員会
happymana
1
260
Realtime API 入門
riofujimon
0
140
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2k
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
490
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.6k
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
300
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
580
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
290
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
430
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.8k
Designing for humans not robots
tammielis
249
25k
Writing Fast Ruby
sferik
627
61k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
Done Done
chrislema
181
16k
RailsConf 2023
tenderlove
29
890
Ruby is Unlike a Banana
tanoku
96
11k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Transcript
P R E S E N T A T I
O N B Y @ m a r u 3 3 3 GraphQLͷεςΩϙΠϯτͱ ·͍͠ϙΠϯτ
- ৽ଔͰSIerۀɻΘΓͱࠈΛΈΔɻ - 201812݄ʹΤϜεϦʔϔɻ - αʔόαΠυKotlinɺGraphQLɻ - αΠίʔ͔Αʂ ← ΠϚίί
@maru333 ָ͚͋ͬͨ͠͞Ͳ
GraphQLͷεςΩϙΠϯτ ✨εςΩ✨
εςΩ̍ GUI͕ॆ࣮͍ͯ͠Δ - query Λͦͷ··ଧͯΔ - ͪΖΜิޮ͘ - σʔλΛ֬ೝͰ͖Δ -
ݕূͨ͠ΫΤϦΛ ɹͦͷ··࣮ίʔυʹ
εςΩ̎ ResponseCode͕200 OK ΫϥΠΞϯτ A Server ʢओཁʣ B Server ʢαϒʣ
GraphQL Server ཁٻ ཁٻ OK ཁٻ NG OK Ұ෦ޭͷσʔλΛॲཧͰ͖Δ
GraphQLͷ·͍͠ϙΠϯτ ·͍͠
GraphQL Server ·͍̍͠ ઃܭ͕ΫϥΠΞϯτͱີʹ Ϣʔβใ χϡʔε ͦͷଞ αʔϏε HOMEͷใ͘Ε HOME
query HomeInfo() ͦͷଞ αʔϏε HOMEͷใͩΑ ϙΠϯτใ Ϣʔβใ ;Ή;Ή HOMEͷ ใͩͳ
·͍̎͠ nginxͷϩάूܭ͕Ͱ͖ͳ͍ - ϩά͕શͯ200 OK - ࠓ·Ͱͷϩάूܭ͕͑ͳ͍ Stackdriver Trace Ͱ
ࢄτϨʔγϯά
- extensions ͷத༷ʑ - ͖উखʹ৭ʑೖͬͯ͠·͏ - εΩʔϚͰఆٛͰ͖ͳ͍ - ΧΦε ·͍̏͠
Τϥʔύλʔϯʹղͳ͠ https://www.apollographql.com/docs/apollo-server/data/errors/ - errors object ʹΤϥʔ͕ೖΔ - extensions ʹ͖ʹ͍ΕͯͶʂ
ݕ౼̍ HTTP Error Status ʹدͤΔ graphql-java Ͱ͜ΕΛΖ͏ͱ͢Δͱɺ ͔ͳΓτϦοΩʔͳ࣮ʹͳΔˍকདྷʹͬͯอূͰ͖ͳ͍ ฐࣾCTOஊɿ nginx
ͱ͔Ͱ HTTP Error Ͳ͏ͤ ൃੜ͢Δ͔Βɺ(ΫϥΠΞϯτͰ ίϯτϩʔϧ͢Δඞཁͷͳ͍ͷ) GraphQLͷΤϥʔHTTP Error ʹ دͤΔͱ͍͏ͷͲ͏͔ʁ → ҰಉɿͳΔ΄Ͳɺ͔֬ʹʂʂʂ
ݕ౼̎ ΤϥʔΫϥεͷఆٛ UserError Unauthorized Error Validation Error query { me
{ … on DataResult {} … on UserError { } } } ͨͩ͠ɺerrorsύλʔϯΔˍHTTP Error ൃੜ͢ΔͨΊɺ ΤϥʔϋϯυϦϯάগ͠ෳࡶʹͳΓͦ͏
·ͱΊ εςΩϙΠϯτͱ ·͍͠ϙΠϯτͷ·ͱΊ - GUIͰ؆୯ʹQueryઃܭ - Ұ෦αʔϏε͕མ͍ͪͯΔঢ়ଶͰಈ࡞Ͱ͖Δ εςΩ - ઃܭ͕ΫϥΠΞϯτͱີʹ
- ࠓ·Ͱͷϩάूܭπʔϧ͑ͳ͍͔ - ΤϥʔͷϕετϓϥΫςΟε͕ແͦ͞͏ ·͍͠
৭ʑ͋Γ·͕͢… GraphQL໘ന͍ʂ օ͞ΜͱҰॹʹݟΛͨΊ͍ͨʂ GraphQLΛ͍ͬͯΔਓͨͪͷू·Γ https://graphql-users-jp.slack.com/
͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ
Vector Icons by Matthew Skiles Presentation template designed by Slidesmash
Photographs by pexels.com Special thanks to all people who made and share these awesome resources for free: Credits
This presentation uses the following typographies and colors: Colors used
Free Fonts used: https://www.fontsquirrel.com/fonts/League-Gothic https://www.fontsquirrel.com/fonts/open-sans Presentation Design