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
110
地方カンファレンス主催のススメ
bumptakayuki
1
150
Laravelで敢えて試す脆弱性のある書き方
bumptakayuki
1
750
地方でのPHPエンジニア採用って実際どうなの?
bumptakayuki
0
520
沖縄観光、名物を一挙紹介!
bumptakayuki
2
530
Laravel ShiftでLaravelのバージョンアップしてみた話
bumptakayuki
1
1.7k
flutterでイベントアプリを作ってみた
bumptakayuki
0
110
オフショア開発の辛みと学んだ事
bumptakayuki
0
340
ChatGPTにStripeのサンプルコードを書かせてみた
bumptakayuki
1
160
Other Decks in Programming
See All in Programming
Tuning GraphQL on Rails
pyama86
2
1.1k
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
200
Java ジェネリクス入門 2024
nagise
0
610
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
130
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
330
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
440
Vue SFCのtemplateでTypeScriptの型を活用しよう
tsukkee
3
1.5k
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.3k
Go言語でターミナルフレンドリーなAIコマンド、afaを作った/fukuokago20_afa
monochromegane
2
140
Hotwire or React? ~Reactの録画機能をHotwireに置き換えて得られた知見~ / hotwire_or_react
harunatsujita
9
4.1k
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
23k
gopls を改造したら開発生産性が高まった
satorunooshie
8
250
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9k
Building an army of robots
kneath
302
42k
Side Projects
sachag
452
42k
Testing 201, or: Great Expectations
jmmastey
38
7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
290
Into the Great Unknown - MozCon
thekraken
31
1.5k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Writing Fast Ruby
sferik
626
61k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
228
52k
GitHub's CSS Performance
jonrohan
1030
460k
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
A better future with KSS
kneath
238
17k
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