Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
GraphQLのステキポイントと悩ましいポイント
maru333
October 09, 2019
Programming
0
2k
GraphQLのステキポイントと悩ましいポイント
maru333
October 09, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
I/O Extended 2022 in Android ~ Whats new in Android development tools
pluu
0
510
模組化的Swift架構(二) DDD速成
haifengkao
0
330
The strategies behind ddd – AdeoDevSummit 2022
lilobase
PRO
4
220
Oracle REST Data Service: APEX Office Hours
thatjeffsmith
0
660
Mobile Product Engineering
championswimmer
0
280
パターンマッチングを学んで新しいJavaの世界へ!Java 18までの目玉機能をおさらいしよう / Java 18 pattern matching
ihcomega56
3
370
Amazon Aurora の v1 が EOL になるので 10 クラスタアップグレードして出てきたノウハウ
dekokun
0
840
What's new in Jetpack / I/O Extended Japan 2022
star_zero
1
170
PythonユーザによるRust入門
rmizuta3
9
3k
git on intellij
hiroto_kitamura
0
160
Node.jsデザインパターンを読んで
mmmommm
0
710
Reactアプリケーションのテスト戦略
0906koki
10
4.6k
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1351
200k
Rebuilding a faster, lazier Slack
samanthasiow
62
7.2k
GitHub's CSS Performance
jonrohan
1020
420k
How New CSS Is Changing Everything About Graphic Design on the Web
jensimmons
213
11k
The Pragmatic Product Professional
lauravandoore
19
2.9k
For a Future-Friendly Web
brad_frost
166
7.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
181
15k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
151
13k
Fontdeck: Realign not Redesign
paulrobertlloyd
73
4.1k
How GitHub (no longer) Works
holman
296
140k
Statistics for Hackers
jakevdp
781
210k
From Idea to $5000 a Month in 5 Months
shpigford
373
44k
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