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.2k
GraphQLのステキポイントと悩ましいポイント
maru333
October 09, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
デザインシステムで Tailwind CSSとCSS in JSに分散投資をしたら良かった話
fsubal
14
3.1k
AppDeveloperCon 2024 EU: Building polyglot developer experiences in 2024
salaboy
0
370
品質とスピードを両立: TypeScriptの柔軟な型システムをバックエンドで活用する
kosui
4
840
「コンパイル時のユニットテスト」導入するとユニットテストを 書かなくてよくなるのか?
tomohisa
9
2.1k
DocC Tutorial と TCA におけるテスト機能の紹介
kalupas226
1
330
設計の知識と技能で駆動するソフトウェア開発
masuda220
PRO
18
10k
Dockerで始めるAWS Lambda開発
stutkhd0709
13
2.5k
ファイル先頭の use の意味、説明できますか? 〜PHP の namespace と autoloading の関係を正しく理解しよう〜 / namespace and autoloading in php
okashoi
2
470
PHPアプリケーションのスケーラビリティと 信頼性を革新する nginx+ngx_mrubyとGoの融合
pyama86
2
240
BuefyのMaintainerを引き継いだ件
kikuomax
0
510
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
480
Data Contracts In Practice With Debezium and Apache Flink (Kafka Summit London)
gunnarmorling
2
270
Featured
See All Featured
Happy Clients
brianwarren
91
6.3k
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
5
1.4k
Fontdeck: Realign not Redesign
paulrobertlloyd
75
4.8k
Git: the NoSQL Database
bkeepers
PRO
421
63k
Creatively Recalculating Your Daily Design Routine
revolveconf
209
11k
VelocityConf: Rendering Performance Case Studies
addyosmani
319
23k
Infographics Made Easy
chrislema
237
18k
Scaling GitHub
holman
456
140k
The Power of CSS Pseudo Elements
geoffreycrofte
58
4.9k
Facilitating Awesome Meetings
lara
39
5.5k
Raft: Consensus for Rubyists
vanstee
130
6.2k
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