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
LaravelでGraphQLを使ってみた
Search
Takayuki
March 04, 2019
Programming
3
200
LaravelでGraphQLを使ってみた
LaravelでGraphQLを使ってみた話
Takayuki
March 04, 2019
Tweet
Share
More Decks by Takayuki
See All by Takayuki
エンジニアのキャリア論
bumptakayuki
0
120
地方カンファレンス主催のススメ
bumptakayuki
1
160
Laravelで敢えて試す脆弱性のある書き方
bumptakayuki
1
790
地方でのPHPエンジニア採用って実際どうなの?
bumptakayuki
0
530
沖縄観光、名物を一挙紹介!
bumptakayuki
2
540
Laravel ShiftでLaravelのバージョンアップしてみた話
bumptakayuki
1
1.8k
flutterでイベントアプリを作ってみた
bumptakayuki
0
110
オフショア開発の辛みと学んだ事
bumptakayuki
0
340
ChatGPTにStripeのサンプルコードを書かせてみた
bumptakayuki
1
170
Other Decks in Programming
See All in Programming
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
イマのCSSでできる インタラクション最前線 + CSS最新情報
clockmaker
3
440
Remix on Hono on Cloudflare Workers
yusukebe
1
300
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
210
watsonx.ai Dojo #4 生成AIを使ったアプリ開発、応用編
oniak3ibm
PRO
1
170
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.3k
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
250
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
120
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
270
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
20
1.1k
Six Lessons from altMBA
skipperchong
27
3.5k
4 Signs Your Business is Dying
shpigford
180
21k
Optimizing for Happiness
mojombo
376
70k
Rails Girls Zürich Keynote
gr2m
94
13k
Navigating Team Friction
lara
183
14k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Designing Experiences People Love
moore
138
23k
RailsConf 2023
tenderlove
29
900
Site-Speed That Sticks
csswizardry
0
33
Adopting Sorbet at Scale
ufuk
73
9.1k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Transcript
LaravelでGraphQLΛ ͬͯΈͨ LaravelでGraphQLΛ ͬͯΈͨ
3 LaravelͰGraphQLΛͬͯΈΔ Agenda 2 GraphQLͱ 1 ࣗݾհ
1 ࣗݾհ
4 ࣗݾհ ◆໊લ ླ ೭(Suzuki Takayuki) ◆ࣗݾհ ɾ1990ɺਆಸݝੜ·Εɻ ɾࣾձਓʹͳ͔ͬͯΒɺϓϩάϥϛϯάΛ࢝ΊΔɻ ɾ2015ʹϑϧεϐʔυʹೖࣾ͠ɺ2017ʹϑϦʔϥϯεΛ
ͬͨޙʹ201711݄ʹԭೄͰىۀɻ ◆झຯ ίεϓϨɺԻָϥΠϒɺϚϥιϯେձʹग़Δɺٿ؍ઓ ◆εΩϧ ɾPHP, Symfony2,CakePHP3,Laravel5, ɾJavaScript, backbone.js,Angular4,Vue.js,Nuxt.js
2 GraphQLͱ
6 GraphQLͱʁ GraphQLFacebookʹΑΓ։ൃ͞ΕͨΦʔϓϯιʔεͷݴޠͰ͢ɻAPI࡞ͷΈͱ͠ ͯRESTͷΘΓʹ͑·͢ɻRESTAPIͷઃܭͱ࣮ʹ͏֓೦্ͷઃܭϞσϧͰ͢ ͕ɺGraphQLඪ४Խ͞Εͨݴޠɺܕ͚ɺ༷Λ࣋ͪΫϥΠΞϯτͱαʔόʔؒΛڧྗ ʹ݁ͼ͚ͭ·͢ɻҟͳΔσόΠεؒͷ௨৴ʹඪ४Խ͞Εͨݴޠ͕͋Δ͜ͱͰɺେܕ͔ͭΫ ϩεϓϥοτϑΥʔϜͷΞϓϦ։ൃ͕ΑΓγϯϓϧʹͳΓ·͢ɻ https://qiita.com/syu_chan_1005/items/3350f1d12c17a77e98c7
7 GraphQLͷϝϦοτ ᶃେྔͰࡶʹͳΓ͕ͪͳWeb APIͷΤϯυϙΠϯτΛ؆ ܿʹཧ͢Δ͜ͱ͕Ͱ͖Δ ᶄܕ҆શͳ Web API Λ࡞ΕΔɻ ᶅϑϩϯτͱαʔόʔؒͷ༷ॻΛɺಈ͍͍ͯΔίʔυ͔
Β໌֬ʹ࡞ΕΔɻ https://qiita.com/acro5piano/items/b9e3acd4af5ec14d7bb1
ϑϩϯτΤϯυ ௨ৗͷREST APIͱͷҧ͍ ~ैདྷͷREST API~ αʔόαΠυ /login ͳͲͳͲ ͳͲͳͲ /users
/posts
ϑϩϯτΤϯυ ௨ৗͷREST APIͱͷҧ͍ ~GraphQLΛͬͨ߹~ αʔόαΠυ ͳͲͳͲ ͳͲͳͲ /graphql
GraphQLΛ͏͜ͱͰେྔͰࡶʹͳΓ ͕ͪͳWeb APIͷΤϯυϙΠϯτΛ؆ܿ ʹཧ͢Δ͜ͱ͕Ͱ͖Δʂʂ
௨ৗͷREST APIͱͷҧ͍ ~GraphQLΛͬͨ߹~ https://labs.getninjas.com.br/sharing-data-in-a-microservices-architecture-using- graphql-97db59357602
3 LaravelͰGraphQLΛͬͯΈΔ
1 3 ϥΠϒϥϦͷछྨ - laravel-graphql - graphql-laravel -laravel-graphql ͔Βੜ -
Lighthouse -ωοτͷهࣄݟΔݶΓͩͱ͜Ε͕ΦεεϝΒ͍͠ https://qiita.com/acro5piano/items/b9e3acd4af5ec14d7bb1
1 4 laravel-graphqlͷಛ ɾgitͷελʔ͕ଟ͍ ɾPHPʹ͍ۙॻ͖ํ͕ग़དྷΔͷͰphperʹ҆৺ײ͕͋Δ https://qiita.com/acro5piano/items/b9e3acd4af5ec14d7bb1
1 5 Lighthouseͷಛ ɾଞ2ͭͷϥΠϒϥϦͱൺͯɺඇৗʹγϯϓϧʹɺ GraphQL ͬΆ͘ॻ͚Δͷ ͕ಛΒ͍͠ɻ ɾΫΤϦఆ͕ٛ GraphQL Ͱॻ͚Δɻ
ɾܕఆ͕ٛγϯϓϧͰ͋Δ https://qiita.com/acro5piano/items/b9e3acd4af5ec14d7bb1
1 6 laravel-graphqlͱLighthouseͷܕఆٛͷൺֱ https://qiita.com/acro5piano/items/b9e3acd4af5ec14d7bb1 laravel-graphql Lighthouse ɾগͳ͍هड़ྔͰࡁΉ ɾGraphQLͬΆ͘ॻ͚Δ
1 7 ࠓճελʔ͕ଟ͍ laravel-graphqlͰಈ͔ͯ͠ΈΔ
1 8 ڥߏஙΛߦͬͯ $ php artisan serve http://127.0.0.1:8000/graphiql ʹΞΫηε͢Δʂ
1 9 laravel-graphqlͰಈ͔ͯ͠Έͨ https://qiita.com/ucan-lab/items/32969d6a9b5aa99b475e query
2 0 laravel-graphqlͰಈ͔ͯ͠Έͨ https://qiita.com/ucan-lab/items/32969d6a9b5aa99b475e mutation
2 1 ࢀߟ Thanks!! ɾLaravel 5.7 + GraphQLʢInstallฤʣ https://qiita.com/ucan-lab/items/32969d6a9b5aa99b475e ɾLaravel
Ͱ GraphQLʙಋೖฤ https://qiita.com/nunulk/items/5c506d8ef391f5e9971c ɾLaravel Ͱ GraphQL ΔͳΒɺ Lighthouse ͕ྑ͍ https://qiita.com/acro5piano/items/b9e3acd4af5ec14d7bb1