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.4k
GraphQLのステキポイントと悩ましいポイント
maru333
October 09, 2019
Tweet
Share
Other Decks in Programming
See All in Programming
技術同人誌をMCP Serverにしてみた
74th
1
450
プロダクト志向ってなんなんだろうね
righttouch
PRO
0
170
Benchmark
sysong
0
280
PostgreSQLのRow Level SecurityをPHPのORMで扱う Eloquent vs Doctrine #phpcon #track2
77web
2
420
RailsGirls IZUMO スポンサーLT
16bitidol
0
120
Team operations that are not burdened by SRE
kazatohiei
1
290
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
130
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
0
260
Hypervel - A Coroutine Framework for Laravel Artisans
albertcht
1
110
Result型で“失敗”を型にするPHPコードの書き方
kajitack
4
550
#QiitaBash MCPのセキュリティ
ryosukedtomita
0
530
なんとなくわかった気になるブロックテーマ入門/contents.nagoya 2025 6.28
chiilog
1
250
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
60k
Scaling GitHub
holman
459
140k
A better future with KSS
kneath
239
17k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
How STYLIGHT went responsive
nonsquared
100
5.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
130
19k
Raft: Consensus for Rubyists
vanstee
140
7k
Code Review Best Practice
trishagee
69
18k
It's Worth the Effort
3n
185
28k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
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