{"id":6687,"date":"2020-04-06T15:00:26","date_gmt":"2020-04-06T06:00:26","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=6687"},"modified":"2020-04-04T22:45:06","modified_gmt":"2020-04-04T13:45:06","slug":"laravel-vue-graphql%e3%81%a7%e3%83%87%e3%83%bc%e3%82%bf%e3%81%ae%e5%8f%96%e5%be%97","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=6687","title":{"rendered":"Laravel + Vue + GraphQL\u3067\u30c7\u30fc\u30bf\u53d6\u5f97"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u306e\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=6646\">axios\u4e0d\u8981\uff01fetch()\u3067Ajax\u901a\u4fe1\u3059\u308b\u65b9\u6cd5<\/a>\u300d\u3067\u306f\u3001\u79c1\u304c\u6700\u8fd1\u307e\u3067\u77e5\u3089\u306a\u304b\u3063\u305f\u65b0\u3057\u3044\u6280\u8853\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u3059\u308b\u3068\u3044\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u3067\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u3082\u305d\u306e\u6d41\u308c\u3067<strong>\u524d\u304b\u3089\u3084\u3063\u3066\u307f\u305f\u304b\u3063\u305f\u5185\u5bb9\u3092\u304a\u5c4a\u3051\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">GraphQL<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p><code>GraphQL<\/code>\u3068\u306f\u3001\u7c21\u5358\u306b\u3044\u3046\u3068<strong>\u4eca\u307e\u3067\u306eSQL\u6587\u3068\u306f\u9055\u3063\u305f\u5f62\u5f0f\u3067DB\u64cd\u4f5c\u3092\u3059\u308b\u6280\u8853\u3067\u3059\u3002<\/strong><\/p>\n<p>\u4f8b\u3048\u3070\u3001\u3053\u308c\u307e\u3067\u306eSQL\u6587\u306f\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u304c\u4e00\u822c\u7684\u3067\u3057\u305f\u3002<\/p>\n<pre><strong>SELECT id, name FROM users<\/strong><\/pre>\n<p>\u3053\u308c\u304c\u3001<code>GraphQL<\/code>\u3067\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>{<\/strong>\r\n<strong>    users {<\/strong>\r\n<strong>      id<\/strong>\r\n<strong>      name<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p>\uff08\u304a\u305d\u3089\u304f\u30b0\u30e9\u30d5\u30a3\u30ab\u30eb\u306a\u3093\u3067\u3053\u306e\u540d\u524d\u304c\u3064\u3044\u305f\u306e\u304b\u306a\u3001\u3068\u52dd\u624b\u306b\u601d\u3063\u3066\u3044\u307e\u3059\ud83d\ude0a\uff09<\/p>\n<p>\u307e\u305f\u3001\u8907\u6570\u30c6\u30fc\u30d6\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u53d6\u5f97\u304c\u3067\u304d\u308b\u306e\u3067\u3001<code>Rest API<\/code>\u3067\u306f<strong>\uff11\u500b\u305a\u3064\u51e6\u7406\u3057\u3066\u3044\u305f\u3082\u306e\u304c\u4e00\u6c17\u306b\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/strong><\/p>\n<pre><strong>{<\/strong>\r\n<strong>    users {<\/strong> \/\/ \ud83d\udc48 users\u30c7\u30fc\u30bf\r\n<strong>      id<\/strong>\r\n<strong>      name<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>    posts {<\/strong> \/\/ \ud83d\udc48 posts\u30c7\u30fc\u30bf\r\n<strong>      id<\/strong>\r\n<strong>      title<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p>\u306a\u304a\u3001DB\u64cd\u4f5c\u3057\u305f\u3044\u30c6\u30fc\u30d6\u30eb\u3060\u3051\u3092<code>schema<\/code>\u3068\u547c\u3070\u308c\u308b\u30d5\u30a1\u30a4\u30eb\u3067\u8a2d\u5b9a\u3057\u305f\u5834\u5408\u3060\u3051\u6709\u52b9\u306b\u306a\u308b\u306e\u3067\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u7684\u306b\u3082\u5b89\u5fc3\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p>\u30fb\u30fb\u30fb\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f<code>Laravel<\/code> \u3067<code>GraphQL<\/code>\u3092\u4f7f\u3046\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<br \/>\n\u305c\u3072\u697d\u3057\u307f\u306a\u304c\u3089\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2173 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png\" alt=\"\" width=\"300\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24-281x300.png 281w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p style=\"text-align: center;\"><strong>\u300c\u8aad\u307f\u65b9\u306f\u3001\uff08\u3050\u3089\u3075\u304d\u3085\u30fc\u3048\u308b\uff09\u3067\u3059\ud83d\ude0a\u300d<\/strong><\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 7.x<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u4eca\u56de\u306f\u5404\u30e6\u30fc\u30b6\u30fc\u304c\u81ea\u7531\u306b\u66f8\u304d\u8fbc\u307f\u304c\u3067\u304d\u308b<code>posts<\/code>\u3068\u3044\u3046\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u308a\u3001<strong><code>GraphQL<\/code>\u3067\u672c\u4eba\u304c\u6295\u7a3f\u3057\u305f\u30c7\u30fc\u30bf\u3060\u3051\u3092\u53d6\u5f97\u3057\u3066\u30ea\u30b9\u30c8\u8868\u793a\u3057\u307e\u3059\u3002<\/strong><\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p><code>Laravel<\/code>\u306b\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001\u3055\u3089\u306b\u30e6\u30fc\u30b6\u30fc\u30c7\u30fc\u30bf\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<p>\u8a73\u3057\u304f\u306f\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=4576\">Laravel6.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a>\u300d\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p><code>Laravel<\/code>\u3067<code>GraphQL<\/code>\u3092\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>composer require nuwave\/lighthouse<\/strong><\/pre>\n<h1>\u6e96\u5099\u3059\u308b<\/h1>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u304b\u3089<code>Laravel<\/code>\u5074\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/p>\n<h2>\u69cb\u6210\u30d5\u30a1\u30a4\u30eb<\/h2>\n<p>\u307e\u305a\u306f\u69cb\u6210\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan vendor:publish --provider=\"Nuwave\\Lighthouse\\LighthouseServiceProvider\" --tag=schema<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p><strong><code>\/graphql\/schema.graphql<\/code><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6693\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_1.png\" alt=\"\" width=\"264\" height=\"184\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001<strong>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u4e2d\u3067\u300c\u3069\u3093\u306a\u64cd\u4f5c\u3092\u53d7\u3051\u4ed8\u3051\u308b\u304b\u300d\u3001\u307e\u305f\u300c\u3069\u3093\u306a\u30c7\u30fc\u30bf\u3092\u8fd4\u3059\u304b\u300d\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/strong><\/p>\n<p>\u3067\u306f\u3001\u4eca\u56de<code>posts<\/code>\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>\/graphql\/schema.graphql<\/code><\/strong><\/p>\n<pre>\"GraphQL\u306e\u30a2\u30af\u30bb\u30b9\u8a2d\u5b9a\"\r\n<strong>type Query {<\/strong>\r\n<strong>    posts(page: Int): [Post!]! @paginate(defaultCount: 3)<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\"posts\u30c6\u30fc\u30d6\u30eb\u306e\u53d6\u5f97\u5185\u5bb9\"\r\n<strong>type Post {<\/strong>\r\n<strong>    id: ID!<\/strong>\r\n<strong>    user_id: Int!<\/strong>\r\n<strong>    title: String!<\/strong>\r\n<strong>    content: String!<\/strong>\r\n<strong>    created_at: String!<\/strong>\r\n<strong>    updated_at: String!<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p>\u3053\u306e\u5185\u5bb9\u3092\u5927\u307e\u304b\u306b\u8aac\u660e\u3059\u308b\u3068\u3001<strong><code>posts<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001<code>posts<\/code>\u306e\u30c7\u30fc\u30bf\u3092\uff11\u30da\u30fc\u30b8\uff13\u4ef6\u3054\u3068\u306e\u914d\u5217\u3067\u8fd4\u3059<\/strong>\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<\/h2>\n<p>\u6b21\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan vendor:publish --provider=\"Nuwave\\Lighthouse\\LighthouseServiceProvider\" --tag=config<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3082\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p><strong><code>\/config\/lighthouse.php<\/code><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6698\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_2.png\" alt=\"\" width=\"249\" height=\"334\" \/><\/p>\n<p>\u4eca\u56de\u306f\u30ed\u30b0\u30a4\u30f3\u30fb\u30e6\u30fc\u30b6\u30fc\u306e\u60c5\u5831\u304c\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u3001\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u306b<code>web<\/code>\u3092\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>\/config\/lighthouse.php<\/code><\/strong><\/p>\n<pre>'middleware' =&gt; [\r\n    <strong>'web'<\/strong>, \/\/ \ud83d\udc48 \u8ffd\u52a0\r\n    \r\n    \/\/ \u7701\u7565\r\n\r\n],<\/pre>\n<h2>\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h2>\n<p><code>posts<\/code>\u30c6\u30fc\u30d6\u30eb\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e2\u30c7\u30eb\u3068\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:model Post -m<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\uff12\u3064\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\n\u305d\u308c\u305e\u308c\u4e2d\u8eab\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/app\/Post.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Builder;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Post extends Model\r\n{\r\n    \/\/ \u30b0\u30ed\u30fc\u30d0\u30eb\u30fb\u30b9\u30b3\u30fc\u30d7\r\n    <strong>protected static function booted() {<\/strong> \/\/ \ud83d\udc48 \u8ffd\u52a0\r\n    \r\n<strong>        static::addGlobalScope('only_user', function (Builder $builder) {<\/strong>\r\n\r\n<strong>            $user_id = -1;<\/strong>\r\n\r\n<strong>            if(auth()-&gt;check()) {<\/strong>\r\n\r\n<strong>                $user_id = auth()-&gt;user()-&gt;id;<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>            $builder-&gt;where('user_id', $user_id);<\/strong>\r\n\r\n<strong>        });<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u306e\u30b0\u30ed\u30fc\u30d0\u30eb\u30fb\u30b9\u30b3\u30fc\u30d7\u306f\u3001<strong>\u30ed\u30b0\u30a4\u30f3\u4e2d\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u6295\u7a3f\u3057\u305f\u30c7\u30fc\u30bf\u3060\u3051\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u3002<\/strong>\uff08\u3064\u307e\u308a\u3001\u4ed6\u4eba\u306e\u30c7\u30fc\u30bf\u3092\u898b\u308b\u3053\u3068\u306f\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\uff09<\/p>\n<p>\u7d9a\u3044\u3066\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u3067\u3059\u306e\u3067\u30b7\u30f3\u30d7\u30eb\u306a\u30c6\u30fc\u30d6\u30eb\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/home\/sukohi\/php-\/database\/migrations\/****_**_**_******_create_posts_table.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function up()<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    Schema::create('posts', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('user_id');<\/strong>\r\n<strong>        $table-&gt;string('title');<\/strong>\r\n<strong>        $table-&gt;text('content');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>        $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users');<\/strong>\r\n<strong>    });<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u5b8c\u4e86\u3057\u305f\u3089\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3067\u3059\u3002<br \/>\n\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066<code>Seeder<\/code>\u3092\u3064\u304f\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan make:seed PostsTableSeeder<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/database\/seeds\/PostsTableSeeder.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function run()<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    $user_ids = \\App\\User::pluck('id');<\/strong>\r\n\r\n<strong>    for($i = 0 ; $i &lt; 100 ; $i++) {<\/strong>\r\n\r\n<strong>        $post = new \\App\\Post();<\/strong>\r\n<strong>        $post-&gt;user_id = $user_ids-&gt;random();<\/strong>\r\n<strong>        $post-&gt;title = '\u30c6\u30b9\u30c8\u30bf\u30a4\u30c8\u30eb - '. $i;<\/strong>\r\n<strong>        $post-&gt;content = \"\u30c6\u30b9\u30c8\u30b3\u30f3\u30c6\u30f3\u30c4\\n\u30c6\u30b9\u30c8\u30b3\u30f3\u30c6\u30f3\u30c4\\n\u30c6\u30b9\u30c8\u30b3\u30f3\u30c6\u30f3\u30c4\\n\";<\/strong>\r\n<strong>        $post-&gt;save();<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001<code>posts<\/code>\u30c6\u30fc\u30d6\u30eb\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6702\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_3.png\" alt=\"\" width=\"640\" height=\"483\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_3.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_3-300x226.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u3067\u3059\u306e\u3067\u3001\u7c21\u7565\u3057\u3066\u66f8\u304d\u307e\u3059\u304c\u5b9f\u969b\u306b\u306f<code>PostController<\/code>\u306a\u3069\u3092\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong><code>\/routes\/web.php<\/code><\/strong><\/p>\n<pre><strong>Route::get('post', function(){ return view('post.index'); });<\/strong><\/pre>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b<code>GraphQL<\/code>\u3067\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link rel=\"stylesheet\" href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\"&gt;\r\n        &lt;!-- \u30ea\u30b9\u30c8\u8868\u793a --&gt;\r\n        <strong>&lt;table class=\"table table-striped\"&gt;<\/strong>\r\n<strong>            &lt;thead&gt;<\/strong>\r\n<strong>                &lt;tr&gt;<\/strong>\r\n<strong>                    &lt;th&gt;ID&lt;\/th&gt;<\/strong>\r\n<strong>                    &lt;th&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/th&gt;<\/strong>\r\n<strong>                    &lt;th&gt;\u5185\u5bb9&lt;\/th&gt;<\/strong>\r\n<strong>                    &lt;th&gt;\u4f5c\u6210\u65e5\u6642&lt;\/th&gt;<\/strong>\r\n<strong>                &lt;\/tr&gt;<\/strong>\r\n<strong>            &lt;\/thead&gt;<\/strong>\r\n<strong>            &lt;tbody&gt;<\/strong>\r\n<strong>                &lt;tr v-for=\"post in posts\"&gt;<\/strong>\r\n<strong>                    &lt;td v-text=\"post.id\"&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                    &lt;td v-text=\"post.title\"&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                    &lt;td style=\"white-space: pre-wrap\" v-text=\"post.content\"&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                    &lt;td v-text=\"post.created_at\"&gt;&lt;\/td&gt;<\/strong>\r\n<strong>                &lt;\/tr&gt;<\/strong>\r\n<strong>            &lt;\/tbody&gt;<\/strong>\r\n<strong>        &lt;\/table&gt;<\/strong>\r\n        &lt;!-- \u30da\u30fc\u30b8\u79fb\u52d5 --&gt;\r\n        <strong>&lt;div class=\"p-3\"&gt;<\/strong>\r\n<strong>            &lt;ul class=\"pagination pg-blue\"&gt;<\/strong>\r\n<strong>                &lt;li class=\"page-item\" v-for=\"page in paginatorInfo.lastPage\"&gt;<\/strong>\r\n<strong>                    &lt;a href=\"#\" class=\"page-link\" v-text=\"page\" @click=\"movePage(page)\"&gt;&lt;\/a&gt;<\/strong>\r\n<strong>                &lt;\/li&gt;<\/strong>\r\n<strong>            &lt;\/ul&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/vue@2.6.11\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.2\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                posts: [],\r\n                paginatorInfo: {},\r\n                page: 1\r\n            },\r\n            methods: {\r\n                <strong>getPosts() { <\/strong>\/\/ \ud83d\udc48 \u30c7\u30fc\u30bf\u53d6\u5f97 \u30fb\u30fb\u30fb \u2460\r\n\r\n<strong>                    const params = {<\/strong>\r\n<strong>                        query:<\/strong>\r\n<strong>                            `{<\/strong>\r\n<strong>                                posts(page: ${this.page}) {<\/strong>\r\n<strong>                                    data {<\/strong>\r\n<strong>                                        id<\/strong>\r\n<strong>                                        title<\/strong>\r\n<strong>                                        content<\/strong>\r\n<strong>                                        created_at<\/strong>\r\n<strong>                                    }<\/strong>\r\n<strong>                                    paginatorInfo {<\/strong>\r\n<strong>                                        currentPage<\/strong>\r\n<strong>                                        lastPage<\/strong>\r\n<strong>                                    }<\/strong>\r\n<strong>                                }<\/strong>\r\n<strong>                            }`<\/strong>\r\n<strong>                    };<\/strong>\r\n<strong>                    axios.post('\/graphql', params)<\/strong>\r\n<strong>                        .then(response =&gt; {<\/strong>\r\n\r\n<strong>                            const posts = response.data.data.posts;<\/strong>\r\n<strong>                            this.posts = posts.data;<\/strong>\r\n<strong>                            this.paginatorInfo = posts.paginatorInfo;<\/strong>\r\n\r\n<strong>                        });<\/strong>\r\n\r\n<strong>                },<\/strong>\r\n                <strong>movePage(page) {<\/strong> \/\/ \ud83d\udc48 \u30da\u30fc\u30b8\u79fb\u52d5 \u30fb\u30fb\u30fb \u2461\r\n\r\n<strong>                    this.page = page;<\/strong>\r\n<strong>                    this.getPosts();<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n            },\r\n            mounted() {\r\n\r\n                this.getPosts();\r\n\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u3001\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p><strong>\u2460 \u30c7\u30fc\u30bf\u53d6\u5f97<\/strong><\/p>\n<p>\u3053\u3053\u3067<code>Ajax<\/code> + <code>GraphQL<\/code>\u3067<code>posts<\/code>\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<span style=\"font-size: 1rem;\">\u3053\u306e\u4e2d\u3067\u3001\u5b9f\u969b\u306b\u9001\u4fe1\u3055\u308c\u308b\u5185\u5bb9\u306f\u4f8b\u3048\u3070\u3001\u6b21\u306e\u3088\u3046\u306a\u3082\u306e\u306b\u306a\u308a\u307e\u3059\u3002<\/span><\/p>\n<pre>{\r\n    posts(page: 1) { \/\/ \ud83d\udc48 \u30da\u30fc\u30b8\u306f\u53ef\u5909\r\n        data {\r\n            id\r\n            title\r\n            content\r\n            created_at\r\n        }\r\n        paginatorInfo {\r\n            currentPage\r\n            lastPage\r\n        }\r\n    }\r\n}<\/pre>\n<p>\u307e\u305f\u3001\u53d6\u5f97\u3055\u308c\u308b\u30c7\u30fc\u30bf\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>\"posts\": {\r\n    \"data\": [\r\n        {\r\n            \"id\": \"2\",\r\n            \"title\": \"\u30c6\u30b9\u30c8\u30bf\u30a4\u30c8\u30eb - 1\",\r\n            \"content\": \"\uff08\u9577\u3044\u306e\u3067\u7701\u7565\uff09\",\r\n            \"created_at\": \"2020-04-04 09:56:12\"\r\n        },\r\n        \/\/ \u305f\u304f\u3055\u3093\u3042\u308b\u306e\u3067\u7701\u7565\r\n    ],\r\n    \"paginatorInfo\":\u3000{\r\n        \"currentPage\":\u30001,\r\n        \"lastPage\":\u30004\r\n    }\r\n}<\/pre>\n<p>\u307e\u305f\u3001\u4eca\u56de\u30da\u30fc\u30b8\u79fb\u52d5\u306e\u90e8\u5206\u306f\u4ee5\u4e0b\uff12\u3064\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>currentPage\uff1a \u73fe\u5728\u306e\u30da\u30fc\u30b8<\/li>\n<li>lastPage\uff1a \u6700\u5f8c\u306e\u30da\u30fc\u30b8<\/li>\n<\/ul>\n<p>\u5b9f\u969b\u306b\u306f\u3053\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u304c\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>paginatorInfo: {<\/strong>\r\n<strong>    currentPage: 1, <\/strong>\r\n<strong>    lastPage: 4<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p><strong>\u2461 \u30da\u30fc\u30b8\u79fb\u52d5<\/strong><\/p>\n<p>\u30da\u30fc\u30b8\u79fb\u52d5\u306f\u3001<code>page<\/code>\u5909\u6570\u306e\u4e2d\u8eab\u3092\u5909\u66f4\u3057<code>getPosts()<\/code>\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u5b8c\u4e86\u3067\u304d\u307e\u3059\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<br \/>\n\u307e\u305a\u306f\u300c<strong>http:\/\/******\/post<\/strong>\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u3053\u308d\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6706\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_4.png\" alt=\"\" width=\"558\" height=\"431\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_4.png 558w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_4-300x232.png 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/p>\n<p>\u30c7\u30fc\u30bf\u306e\u4e00\u89a7\u3068\u30da\u30fc\u30b8\u79fb\u52d5\u30ea\u30f3\u30af\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002\uff08\u3057\u304b\u3082\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306f\u30ed\u30b0\u30a4\u30f3\u30e6\u30fc\u30b6\u30fc\u304c\u6295\u7a3f\u3057\u305f\u3082\u306e\u3060\u3051\u3067\u3059\uff09<\/p>\n<p>\u3067\u306f\u3001\uff12\u30da\u30fc\u30b8\u76ee\u306b\u79fb\u52d5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6705\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_5.png\" alt=\"\" width=\"558\" height=\"428\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_5.png 558w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_5-300x230.png 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/p>\n<p>\u306f\u3044\uff01<br \/>\n\u8868\u793a\u5185\u5bb9\u304c\u5165\u308c\u66ff\u308f\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u307e\u3051\uff1a\u30c6\u30b9\u30c8\u306b\u4fbf\u5229\u306a\u30c4\u30fc\u30eb<\/h1>\n<p><code>GraphQL<\/code>\u3092\u30c6\u30b9\u30c8\u3067\u8a66\u3059\u3053\u3068\u304c\u3067\u304d\u308b\u300c<strong>laravel-graphql-playground<\/strong>\u300d\u3068\u3044\u3046\u4fbf\u5229\u306a\u30c4\u30fc\u30eb\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6707\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_6.png\" alt=\"\" width=\"625\" height=\"391\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_6.png 625w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_graphql_6-300x188.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>\u3053\u308c\u306f\u3001<strong><code>GraphQL<\/code>\u3092\u66f8\u3044\u3066\u9001\u4fe1\u3059\u308b\u3060\u3051\u3067\u300c\u3069\u3093\u306a\u7d50\u679c\u306b\u306a\u308b\u304b\u2753\u300d\u304c\u308f\u304b\u308b\u30b9\u30b0\u30ec\u30e2\u30ce\u3067\u3059\u3002<\/strong><\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067OK\u3067\u3059\u3002<\/p>\n<pre><strong>composer require mll-lab\/laravel-graphql-playground<\/strong><\/pre>\n<p>\u306a\u304a\u3001419\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u5834\u5408\u306f\u3001\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3067<code>csrf<\/code>\u3092\u7121\u52b9\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><strong><code>\/app\/Http\/Middleware\/VerifyCsrfToken.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Middleware;\r\n\r\nuse Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken as Middleware;\r\n\r\nclass VerifyCsrfToken extends Middleware\r\n{\r\n    protected $except = [\r\n        <strong>'\/graphql'<\/strong> \/\/ \ud83d\udc48 \u8ffd\u52a0\r\n    ];\r\n}<\/pre>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u3067<code>GraphQL<\/code>\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001<code>GraphQL<\/code>\u3092\u521d\u3081\u3066\u4f7f\u3063\u305f\u308f\u3051\u3067\u3059\u304c\u3001<strong>\u300c\u7279\u306b\u30c7\u30fc\u30bf\u53d6\u5f97\u306b\u5411\u3044\u3066\u3044\u308b\u2757\u300d\u3068\u611f\u3058\u307e\u3057\u305f\u3002<\/strong><\/p>\n<p>\u5192\u982d\u3067\u3082\u66f8\u3044\u305f\u3068\u304a\u308a\u3001\u3053\u308c\u307e\u3067\u306f<strong>\uff11\u3064\u305a\u3064\u30c6\u30fc\u30d6\u30eb\u3054\u3068\u306b\u53d6\u5f97\u3057\u3066\u3044\u305f\u306e\u3082\u306e\u3092\u4e00\u6c17\u306b\u53d6\u5f97\u3067\u304d\u308b\u306e\u306f\u3068\u3066\u3082\u9b45\u529b\u7684\u3067\u3059\u3002<\/strong>\uff08\u5b9f\u969b\u554f\u984c\u3053\u308c\u3092\u89e3\u6c7a\u3059\u308b\u305f\u3081\u306b\u72ec\u81ea\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u3064\u304f\u3063\u305f\u308a\u3082\u3057\u3066\u307e\u3057\u305f\ud83d\ude05\uff09<\/p>\n<p>\u9006\u306b\u300c\u3046\u30fc\u3093\u30fb\u30fb\u30fb\ud83d\udca6\u300d\u3068\u306a\u3063\u305f\u306e\u306f\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306e\u90e8\u5206\u3067\u3059\u3002\u3082\u3061\u308d\u3093<code>GraphQL<\/code>\u306b\u3082\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001<strong>\u6b63\u76f4\u306a\u3068\u3053\u308d\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f<code>Laravel<\/code>\u306e\u3082\u306e\u3092\u305d\u306e\u307e\u307e\u4f7f\u3046\u307b\u3046\u304c\u958b\u767a\u52b9\u7387\u306f\u9ad8\u3044\u3068\u611f\u3058\u307e\u3057\u305f\u3002<\/strong><\/p>\n<p>\u307e\u305f\u3001\u5c11\u3057\u8907\u96d1\u306a\u3053\u3068\u3092\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u30b3\u30fc\u30c9\u306e\u53ef\u8aad\u6027\u304c\u4e00\u6c17\u306b\u60aa\u304f\u306a\u308b\u306e\u3067\u3001\u500b\u4eba\u7684\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u56fa\u5b9a\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306a\u3089\u4f7f\u3044\u305f\u3044\u304b\u306a\u3001\u3068\u3044\u3046\u5370\u8c61\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u90fd\u9053\u5e9c\u770c\u30c7\u30fc\u30bf<\/li>\n<li>\u4e8b\u696d\u6240\u30c7\u30fc\u30bf<\/li>\n<li>\u306f\u3044\uff0f\u3044\u3044\u3048\uff0f\u672a\u5b9a<\/li>\n<\/ul>\n<p>\u306a\u3069\u306a\u3069\u3002<\/p>\n<p>\u305f\u3060\u3001\u4eca\u5f8c\u3082<code>GraphQL<\/code>\u306b\u306f\u6ce8\u76ee\u3057\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\ud83d\ude0a\u2728<br \/>\n\u305c\u3072\u7686\u3055\u3093\u3082\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3467 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><\/p>\n<p style=\"text-align: center;\"><strong>\u300c\u306a\u305c\u304b\u3001&#8221;\u3050\u3089\u3075\u304d\u3085\u30fc\u3048\u308b&#8221;\u3063\u3066\u3001<\/strong><br \/>\n<strong>\u4f55\u56de\u3082\u8a00\u3044\u305f\u304f\u306a\u308a\u307e\u305b\u3093\u304b\u2753\ud83d\ude01\u300d<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u306e\u300caxios\u4e0d\u8981\uff01fetch()\u3067Ajax\u901a\u4fe1\u3059\u308b\u65b9\u6cd5\u300d\u3067\u306f\u3001\u79c1\u304c\u6700\u8fd1\u307e\u3067\u77e5\u3089\u306a\u304b\u3063\u305f\u65b0\u3057\u3044\u6280\u8853\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u3059\u308b\u3068\u3044\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u3067\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=6687\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + Vue + GraphQL\u3067\u30c7\u30fc\u30bf\u53d6\u5f97&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":6713,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[210],"class_list":["post-6687","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-graphql"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6687"}],"version-history":[{"count":21,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6687\/revisions"}],"predecessor-version":[{"id":6717,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/6687\/revisions\/6717"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/6713"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}