Upgrade to Pro — share decks privately, control downloads, hide ads and more …

初心者がほぼ知識ゼロで触ってみたGraphQLの感想

benzookapi
October 14, 2018

 初心者がほぼ知識ゼロで触ってみたGraphQLの感想

benzookapi

October 14, 2018
Tweet

More Decks by benzookapi

Other Decks in Technology

Transcript

  1. ͭͳ͙ଆʢΫϥΠΞϯτʣ GraphQL vs REST ࣮૷ίετͷ௿͞ G ≒ R (ϥΠϒϥϦ࢖͑͹มΘΒͳ͍ʁʣ ύϑΥʔϚϯε

    G > R (G͸ίʔϧ਺ΛݮΒͤΔ෼͚ͩૣ͍ʁʣ ίʔυͷগͳ͞ɾՄ ಡੑ G > R (G͸ίʔϧ਺ΛݮΒͤΔ෼͚ͩઅ໿ɺ؆୯ʁʣ ϝϯςφϯεੑ G ≒ R (࢓༷มߋͷίετ͸ಉ͡ʁʣ
  2. ఏڙ͢Δଆʢαʔόʔʣ GraphQL vs REST ࣮૷ίετͷ௿͞ GraphQL < REST (G͸࿈݁΍ෛՙઃܭ͕େมʁʣ ύϑΥʔϚϯε

    GraphQL ≒ < REST (ઃܭ࣍ୈ͕ͩRͷํָ͕ͦ͏ʣ ίʔυͷগͳ͞ɾՄ ಡੑ GraphQL ≒ < REST (ઃܭ࣍ୈ͕ͩGͷํ͕൥ࡶʹͳΓ͕ͪʁʣ ϝϯςφϯεੑ GraphQL > REST (G͸όʔδϣϯϨεͰεΩʔϚఏڙʣ
  3. ݁࿦ ͻΐͬͱͯࣗ͠෼͕ཉ͍͠ͷͬͯ͜͏͍͏΍ͭͩͬͨɾɾʁ Request: SQL select id, name from employee where

    id = 1; Response: JSON {id: 1, name: “me”} https://myapi.com/ (Single endpoint) Method: POST Headers: REST compatible (Auth) Status: REST compatible (Error handling)