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

活用パターンで学ぶGraphQL

 活用パターンで学ぶGraphQL

クラスメソッド年次技術イベント「Developers.IO 2020 CONNECT」 で登壇した内容です。

Taewoo Kim

June 26, 2020
Tweet

More Decks by Taewoo Kim

Other Decks in Programming

Transcript

  1. (SBQI2-ͷ֓೦ɿొ৔എܠ   ϝϯςφϯε͕ݫ͘͠ͳΔ͔Βɺ࠷ॳ͔ΒඞཁͳϑΟʔ ϧυͷΈϦΫΤετ͢Δ (&5BQJVTFST QBHF@OVNpFMETBDDPVOU*E  OJDLOBNF JNBHF

    X@ I@ NPEF (&5BQJVTFST QBHF@OVNpFMETBDDPVOU*E  OJDLOBNF CJSUI JOUFSFTUT JNBHF X@ I@ NPEF JODMVEFGSJFOE@MJTU
  2. (SBQI2-ͷ֓೦ɿొ৔എܠ   ͔͠͠ɺϑϩϯτΤϯυଆͰ͸ APIΛཧղͮ͠Β͘ͳΔ ΋͏Θ͚͕Θ͔Βͳ͍APIʹͳΔ (&5BQJVTFST QBHF@OVNpFMETBDDPVOU*E  OJDLOBNF

    JNBHF X@ I@ NPEF (&5BQJVTFST QBHF@OVNpFMETBDDPVOU*E  OJDLOBNF CJSUI JOUFSFTUT JNBHF X@ I@ NPEF JODMVEFGSJFOE@MJTU
  3. (SBQI2-ͷ֓೦ɿTBNQMFSFRSFTQ   query { users { accountId name imageUrl

    } } { “data”: { “accountId”: “twkiiim”, “name”: “Taewoo Kim”, “imageUrl”: “…..” } } Request Response
  4. (SBQI2-ͷ֓೦ɿλΠϓʢ5ZQFʣ   (SBQI2-͸λΠϓγεςϜ type User { id: ID! accountId:

    String! name: String! imageUrl: String address: Address } type Address { zipcode: String! city: String! } type Chatroom { id: ID! users: [User!]! createdAt: DateTime! }
  5. (SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ   ඇಉظαʔόʔϨε w ֤ϚΠΫϩαʔϏε͸αʔόʔϨεͰ࣮૷͞Εͯ͋Δ w ֤αʔϏε͸ΠϕϯτετΞ͔ΒΠϕϯτΛड͚෇͚ͯॲཧ ͢Δ w

    ಉ༷ͷΠϕϯτ͸Կճॲཧͯ͠΋ಉ͡ঢ়ଶʹͳΔΑ͏ʹ࣮ ૷͢Δʢ*EFNQPUFOUʣ w Πϕϯτͷॱ൪ʹӨڹΛड͚ͳ͍
  6. (SBQI2-ύλʔϯɿ5ISFF'BDUPS"QQ   https://3factor.app/ 1. ϦΞϧλΠϜGraphQL 2. ϦϥΠΞϏϦςΟͷͨΊͷΠϕϯτॲཧ 3. ඇಉظαʔόʔϨε

    $234ύλʔϯͱ͸ʁ w $PNNBOE2VFSZ3FTQPOTJCJMJUZ4FHSFHBUJPOͷུޠ w ΫΤϦͱϛϡʔςʔγϣϯΛ෼཭ͯ͠ߟ͑ΔΞϓϩʔν w 5ISFF'BDUPS"QQ͸(SBQI2-Ͱ$234ύλʔϯΛ ࣮૷͢ΔͨΊͷํ๏