$30 off During Our Annual Pro Sale. View Details »

いかにして GraphQL を組織に導入するか (新規開発編) / how we introd...

qsona
August 31, 2022

いかにして GraphQL を組織に導入するか (新規開発編) / how we introduce GraphQL on scratch development

GraphQL Tokyo #18 Lightning Talks https://www.meetup.com/ja-JP/graphql-tokyo/events/286913987/

Links:
[GraphQL を活用したスキーマ駆動開発の実践](https://speakerdeck.com/qsona/schema-driven-development-with-graphql)
[GraphQL を利用したアーキテクチャの勘所 / Architecture practices with GraphQL - Speaker Deck](https://speakerdeck.com/qsona/architecture-practices-with-graphql)
[Quramy/gql-study-workshop](https://github.com/Quramy/gql-study-workshop)
[Schema-Driven Development とアジャイルなチーム](https://note.com/qsona/n/nfc73a8e82dff)

qsona

August 31, 2022
Tweet

More Decks by qsona

Other Decks in Technology

Transcript

  1. whoami • @qsona • Web Engineer at ελσΟαϓϦ (ϦΫϧʔτ) •

    Node.js / Rails / GraphQL / Microservices • Engineering Manager ͸͡Ί·ͨ͠
  2. ৽ن։ൃϓϩδΣΫτͷ঺հ • ελσΟαϓϦͷ͏ͪɺதֶੜͷϢʔβʔΛର৅ʹ
 αʔϏεΛϦχϡʔΞϧ͢ΔϓϩδΣΫτ • ։ൃ͢Δ΋ͷ • iOS / Android

    / PC Web Apps • Backend APIs • ίϯςϯπΛ؅ཧ͢ΔγεςϜ • ։ൃظؒ: 2020-04 ։࢝, 2022-02 ϦϦʔε (ͦͷޙ΋ܧଓͯ͠։ൃӡ༻த) ֶशαʔϏεΛϑϧεΫϥονͰ ࡞ΔΠϝʔδ
  3. ͳͥ GraphQL Λಋೖ͔ͨͬͨ͠ͷ͔ (1) • εΩʔϚۦಈ։ൃʹΑΓɺطଘͷ૊৫త ՝୊ΛղܾͰ͖Δ • Client ͔Β

    Backend ·Ͱશͯ GraphQL ʹ͢Δ͜ͱͰ
 ։ൃੜ࢈ੑΛߴΊΔ͜ͱ͕Ͱ͖Δ • ... ͳͲ͕Ұൠతͳ࿩ɺࠓճ͸͋·ΓਂງΓ ͠ͳ͍ (ଞࢿྉ΁ͷϦϯΫష͓͖ͬͯ·͢)
  4. ͳͥ GraphQL Λಋೖ͔ͨͬͨ͠ͷ͔ (2) • ૊৫ಛ༗ͷ࿩: ʮωΠςΟϒΞϓϦޙ௥͍։ൃ໰୊ʯ • Backend +

    Web Frontend Λ͔ͶΔ։ൃऀ͕ଟ͍ • Web ΞϓϦઌߦɺωΠςΟϒΞϓϦʹ͸ޙ͔Β࣮૷͞ΕΔػೳ͕ଟ͔ͬͨ • API υΩϡϝϯτ͕ͳ͔ͬͨΓɺWeb ͷը໘ʹدͬͨ API ࢓༷ʹͳ͍ͬͯͯɺ
 ޙ͔ΒωΠςΟϒΞϓϦͷ࣮૷࣌ʹࠔΔ͜ͱ͕ଟ͔ͬͨ • GraphQL ͸͜ΕΒΛղܾ͢Δ
  5. ྑ͍ϓϥΫςΟεΛద༻͢Δ • ...͋Δ͍͸ɺϔΠτ͕ͨ·ΔઃܭΛճආ͢Δ • ආ͚ͨઃܭͷྫ • Client ʹ Repository ૚Λஔ͘

    • GraphQL Gateway + 
 Backend REST/gRPC ύλʔϯ • ։ൃऀ͕ "ͳΜ͔໘౗ͩͳ" ͱࢥ͏͜ͱ͕ଟ͔ͬͨΒෛ͚
  6. ςΟʔνϯάɾίʔνϯά • ৽͍֓͠೦ͳͷͰɺͦΕΛ਎ʹ͚ͭΔʹ͸
 ͕͔͔࣌ؒΔ • ಛʹϙΠϯτʹͳΔ͜ͱ • όοΫΤϯυ: ࠶ؼతͳ resolve

    • ϑϩϯτΤϯυ: Fragment colocation • ϫʔΫγϣοϓ΍ϞϒϓϩάϥϛϯάͳͲΛ௨ͯ͠ɺ
 ঃʑʹ૊৫ͷ஌ࣝͱͯ֫͠ಘ͍ͯ͘͠
  7. BFF vs GraphQL • BFF (Backend for Frontend) ͷಋೖΛٻΊΔ੠͕
 ωΠςΟϒΤϯδχΞΛத৺ʹ͋ͬͨ

    (͕ɺ൓ରͨ͠) • BFF ͸ Backend - Frontend ͷ૊৫Λૄʹ͍ͨ͠ͱ͖༗ޮ • ʮωΠςΟϒޙ௥͍։ൃʯͷͭΒΈΛܦݧ͍ͯ͠ΔͷͰɺ
 ωΠςΟϒΤϯδχΞ͔Β BFF ͷఏҊ͕ग़ͯ͘Δͷ͸े෼ཧղͰ͖Δ • ͔͠͠ɺࠓճ͸৽ن։ൃͰ1ͭͷϓϩμΫτΛ࡞্͍ͬͯ͘Ͱɺ
 Ή͠ΖີͰ͋Γ͍ͨͱߟ͑ͨ
  8. We are hiring! • GraphQL ΊͬͪΌ΍ͬͯ·͢ • GraphQL ޷͖ͳํͱ͔ɺֶशαʔϏεʹڵຯ͋Δํͥͻ •

    ελσΟαϓϦͱͯ͠࠾༻΍ͬͯ·͢ • Twitter @qsona ʹ DM ͍ͩ͘͞! ΧδϡΞϧ໘ஊ͠·͠ΐ͏ʙ