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

GraphQL で変わったこと・変わらなかったこと / graphql changing an...

qsona
June 02, 2020

GraphQL で変わったこと・変わらなかったこと / graphql changing and unchanging

qsona

June 02, 2020
Tweet

More Decks by qsona

Other Decks in Technology

Transcript

  1. whoami • @qsona • Web Developer at Quipper Limited •

    ͖ͪͽʔॳࢀՃ!!! ͏Ε͍͠!!! ٢঵ࣉԕ͍!!!
  2. ࠓ೔ͷ࿩ • ͜Ε·ͰԿ౓͔ GraphQL & Rails Ͱ API ։ൃΛͯ͠
 ຊ൪ϦϦʔεͨ͠

    • RESTful ࣌୅ͱʮมΘͬͨ͜ͱɾมΘΒͳ͔ͬͨ͜ͱʯ
 ʹ͍ͭͯ࿩͍ͨ͠
  3. લఏ • Web API ͸ Internal use Λ૝ఆ͢Δ • πʔϧɾΤίγεςϜͷ࿩͸Ұ੾͠ͳ͍

    • APIͷઃܭɾ࣮૷ͷ࿩͚ͩ • ਅͷREST (Hypermedia API) ͷ࿩͸͠ͳ͍
  4. Usecase-based Web API • ΫϥΠΞϯτͷϢʔεέʔεʹ߹Θͤͯ Web API Λ࡞Δ • Ϣʔεέʔε

    ≒ ը໘ • ໰୊఺ • ࣅͨΑ͏ͳAPI͕ཚཱ͠΍͍͢ • ຖ౓API࡞Δͷ͕໘౗ =>
 ෳ਺ͷϢʔεέʔεʹରԠ͢Δ ਆAPI ͕Ͱ͖Δ܏޲
  5. RESTful ࣌୅ͷࢦ਑ • جຊతʹ Resource ϕʔεΛબ୒͢Δ • Resource Λద੾ͳཻ౓Ͱఏڙ͢Δ •

    ςʔϒϧ୯ҐͰ͸ͳ͍ • ΞϓϦέʔγϣϯ্ͷυϝΠϯϞσϧΛߟ࡯͠ɺͦΕʹ߹ΘͤΔ • Ͳ͏ͯ͠΋ඞཁͳΒผ్ Usecase ༻ͷ endpoint Λੜ΍͢
  6. GraphQL • Schema ͕ Type ͷ άϥϑߏ଄ʹͳ͍ͬͯΔ • query Ͱ

    field Λࢦఆ͢Δ͜ͱͰɺ
 άϥϑͷதͷऔಘ͢Δ෦෼ΛࢦఆͰ͖Δ
  7. GraphQL ࣌୅ͷࢦ਑ • GraphQL Type ͕ Resource Λද͢ • query

    ͕ Usecase Λද͢ • Query Type ͷ field ͕ endpoint Ͱ͋Δ • ͭ·ΓɺResource ϕʔεͷAPIͱ Usecase ϕʔεͷAPIͷ
 ྑ͍ͱ͜ΖΛཱ྆Ͱ͖Δ!