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
210
LaravelでGraphQLを使ってみた
LaravelでGraphQLを使ってみた話
Takayuki
March 04, 2019
Tweet
Share
More Decks by Takayuki
See All by Takayuki
エンジニアのキャリア論
bumptakayuki
0
140
地方カンファレンス主催のススメ
bumptakayuki
1
170
Laravelで敢えて試す脆弱性のある書き方
bumptakayuki
1
900
地方でのPHPエンジニア採用って実際どうなの?
bumptakayuki
0
580
沖縄観光、名物を一挙紹介!
bumptakayuki
2
580
Laravel ShiftでLaravelのバージョンアップしてみた話
bumptakayuki
1
2.1k
flutterでイベントアプリを作ってみた
bumptakayuki
0
130
オフショア開発の辛みと学んだ事
bumptakayuki
0
360
ChatGPTにStripeのサンプルコードを書かせてみた
bumptakayuki
1
190
Other Decks in Programming
See All in Programming
Lottieアニメーションをカスタマイズしてみた
tahia910
0
130
DROBEの生成AI活用事例 with AWS
ippey
0
130
Ruby on cygwin 2025-02
fd0
0
150
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
GoとPHPのインターフェイスの違い
shimabox
2
190
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
560
PHP ステートレス VS ステートフル 状態管理と並行性 / php-stateless-stateful
ytake
0
100
時計仕掛けのCompose
mkeeda
1
300
Grafana Cloudとソラカメ
devoc
0
170
もう僕は OpenAPI を書きたくない
sgash708
5
1.8k
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
130
Introduction to kotlinx.rpc
arawn
0
700
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
630
How STYLIGHT went responsive
nonsquared
98
5.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
50k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Large-scale JavaScript Application Architecture
addyosmani
511
110k
Automating Front-end Workflow
addyosmani
1368
200k
Designing for Performance
lara
604
68k
Music & Morning Musume
bryan
46
6.3k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
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