アプリ開発の流れを変える「GraphQL」はRESTとどう違うのか比較してみた - WPJ
githubからcloneして
各フォルダ内でnpm install
する。
そしてnpm start dev
。
1 + M + M + sum(Am)
この計算は何? 1回・・・もとのAPI「1 call to get the movie links」 Mは映画分の画像取得?「For each movie link, grab the movie object」 もう1つのMは?「One call (for each movie) to get the links to actors in this movie」かな? sum(Am)・・・1映画についての俳優
ここでは映画のフィールドは8つのうち2つのみ、俳優は7つのうち2つのみ
{ "id": 1, "title": "The Shawshank Redemption", "release_year": 1993, "tags": [ "Crime", "Drama" ], "rating": 9.3, "actors": [ { "id": 1, "name": "Tim Robbins", "dob": "10/16/1958", "num_credits": 73, "image": "https://images-na.ssl-images-amazon.com/images/M/MV5BMTI1OTYxNzAxOF5BMl5BanBnXkFtZTYwNTE5ODI4._V1_.jpg", "href": "http://localhost:3000/actor/1", "movies": "http://localhost:3000/actor/1/movies" }, { "id": 2, "name": "Morgan Freeman", "dob": "06/01/1937", "num_credits": 120, "image": "https://images-na.ssl-images-amazon.com/images/M/MV5BMTc0MDMyMzI2OF5BMl5BanBnXkFtZTcwMzM2OTk1MQ@@._V1_UX214_CR0,0,214,317_AL_.jpg", "href": "http://localhost:3000/actor/2", "movies": "http://localhost:3000/actor/2/movies" } ], "image": "https://images-na.ssl-images-amazon.com/images/M/MV5BODU4MjU4NjIwNl5BMl5BanBnXkFtZTgwMDU2MjEyMDE@._V1_UX182_CR0,0,182,268_AL_.jpg", "href": "http://localhost:3000/movie/1" },
id title release_year tags rating actors image href の8つのうち titleとimage
id name dob num_credits image href movies のうち name、image