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

TypeScript と React Hooks と GraphQL のステキな関係性

TypeScript と React Hooks と GraphQL のステキな関係性

Yudai Shinnoki

December 12, 2019
Tweet

More Decks by Yudai Shinnoki

Other Decks in Programming

Transcript

  1. 'SPOUFOE 1SJNJUJWF$PNQPOFOUT -JCSBSZ $POUBJOFS$PNQPOFOUT 4UBUF 6* $PNQPOFOUT 8FC"1* #BDLFOE ࣗ෼Ͱܕఆٛ͢Δൣғ

    ʢ͍͍ͩͨ͜Μͳײͩ͡Ζ͏ͱ͍͏ਤ
 ɹɹͳͷͰ͋·Γ৴༻͠ͳ͍Ͱ͍ͩ͘͞ʣ
  2. 'SPOUFOE 1SJNJUJWF$PNQPOFOUT -JCSBSZ $POUBJOFS$PNQPOFOUT 4UBUF 6* $PNQPOFOUT 8FC"1* #BDLFOE ࣗ෼Ͱܕఆٛ͢Δൣғ

    w جຊͱͳΔ8FC"1*΍3FBDUͷجຊ ίϯϙʔωϯτ͸UZQFTDSJQUMJC΍
 !UZQFTSFBDUʹఆٛࡁΈ w ϥΠϒϥϦ΋Ͱ͖ΔݶΓܕఆٛͷ͋Δ΋ ͷΛ࢖͏
  3. 'SPOUFOE 1SJNJUJWF$PNQPOFOUT -JCSBSZ $POUBJOFS$PNQPOFOUT 4UBUF 6* $PNQPOFOUT 8FC"1* #BDLFOE ࣗ෼Ͱܕఆٛ͢Δൣғ

    w جຊͱͳΔ8FC"1*΍3FBDUͷجຊ ίϯϙʔωϯτ͸UZQFTDSJQUMJC΍
 !UZQFTSFBDUʹఆٛࡁΈ w ϥΠϒϥϦ΋Ͱ͖ΔݶΓܕఆٛͷ͋Δ΋ ͷΛ࢖͏ w 6*$PNQPOFOUʹ͍ͭͯ͸QSPQTΛ্ ख͘ܧঝͨ͠ΓTUZMFEDPNQPOFOUT Λ࢖͑͹ඞཁ࠷খݶͰࡁΉ
  4. 'SPOUFOE 1SJNJUJWF$PNQPOFOUT -JCSBSZ $POUBJOFS$PNQPOFOUT 4UBUF 6* $PNQPOFOUT 8FC"1* #BDLFOE ࣗ෼Ͱܕఆٛ͢Δൣғ

    w جຊͱͳΔ8FC"1*΍3FBDUͷجຊ ίϯϙʔωϯτ͸UZQFTDSJQUMJC΍
 !UZQFTSFBDUʹఆٛࡁΈ w ϥΠϒϥϦ΋Ͱ͖ΔݶΓܕఆٛͷ͋Δ΋ ͷΛ࢖͏ w 6*$PNQPOFOUʹ͍ͭͯ͸QSPQTΛ্ ख͘ܧঝͨ͠ΓTUZMFEDPNQPOFOUT Λ࢖͑͹ඞཁ࠷খݶͰࡁΉ w 4UBUFͷઃܭ΍֎քͱͷ௨৴͸υϝΠ ϯ஌ࣝͰ͋Γࣗ෼ͨͪͰఆٛ͢Δ
  5. 'SPOUFOE 1SJNJUJWF$PNQPOFOUT -JCSBSZ $POUBJOFS$PNQPOFOUT 4UBUF 6* $PNQPOFOUT 8FC"1* #BDLFOE ࣗ෼Ͱܕఆٛ͢Δൣғ

    w جຊͱͳΔ8FC"1*΍3FBDUͷجຊ ίϯϙʔωϯτ͸UZQFTDSJQUMJC΍
 !UZQFTSFBDUʹఆٛࡁΈ w ϥΠϒϥϦ΋Ͱ͖ΔݶΓܕఆٛͷ͋Δ΋ ͷΛ࢖͏ w 6*$PNQPOFOUʹ͍ͭͯ͸QSPQTΛ্ ख͘ܧঝͨ͠ΓTUZMFEDPNQPOFOUT Λ࢖͑͹ඞཁ࠷খݶͰࡁΉ w 4UBUFͷઃܭ΍֎քͱͷ௨৴͸υϝΠ ϯ஌ࣝͰ͋Γࣗ෼ͨͪͰఆٛ͢Δ w 4UBUF͕มΘΔͱ$POUBJOFS $PNQPOFOUT΋มΘΔͷͰෆ҆ఆ
  6. )0$ )PPLT ྫSFBDUSFEVY )PPLTҎલ w DPOOFDUͱ͍͏)0$ ߴ֊ίϯϙʔω ϯτίϯϙʔωϯτΛฦ͢ίϯϙʔω ϯτ ͰίϯϙʔωϯτΛғͬͯ

    QSPQTʹ஋Λ஫ೖ w ͲͷΑ͏ͳQSPQT͕஫ೖ͞ΕΔ͔஫ҙ ͕ඞཁ )PPLTΛ࢖͏ͱ w VTF4FMFDUPSVTF%JTQBUDIͱ͍͏
 )PPLTΛ࢖͍SFOEFS಺Ͱ஋Λ஫ೖ w QSPQTΛհ͓ͯ͠ΒͣɺSFOEFSΛݟΕ͹
 શ͕ͯ෼͔Δ
  7. 3FBDU)PPLTͱ͸݁ہԿͳͷ͔ )0$ )PPLT SFOEFS SFOEFS )PPLTҎલ w ਌ίϯϙʔωϯτ΍)0$͔Β౉͞ΕΔ QSPQT͕มԽ͢Δ͜ͱͰ࠶SFOEFS w

    $MBTT$PNQPOFOUͰ͸TFU4UBUFͰ
 ࣗ෼ࣗ਎ͷSFOEFSΛଅ͢͜ͱ͕ग़དྷͨ )PPLTΛ࢖͏ͱ w QSPQTΛհͣ͞ʹ஋Λ஫ೖͰ͖Δ w SFOEFS಺ʹॻ͍ͨ)PPLTʹΑͬͯ
 ࣗ෼ࣗ਎͕࠶SFOEFS͞ΕΔՄೳੑ͕͋Δ SFOEFS͕ԿͰ΋Ͱ͖ͯ͠·͏ͷ͸͕ͩ ܕਪ࿦͠΍͘͢5ZQF4DSJQUͱ͸૬ੑ͕͍͍
  8. 'SPOUFOE 1SJNJUJWF$PNQPOFOUT -JCSBSZ $POUBJOFS$PNQPOFOUT 4UBUF 6* $PNQPOFOUT 8FC"1* #BDLFOE ࣗ෼Ͱܕఆٛ͢Δൣғ

    w جຊͱͳΔ8FC"1*΍3FBDUͷجຊ ίϯϙʔωϯτ͸UZQFTDSJQUMJC΍
 !UZQFTSFBDUʹఆٛࡁΈ w ϥΠϒϥϦ΋Ͱ͖ΔݶΓܕఆٛͷ͋Δ΋ ͷΛ࢖͏ w 6*$PNQPOFOUʹ͍ͭͯ͸QSPQTΛ্ ख͘ܧঝͨ͠ΓTUZMFEDPNQPOFOUT Λ࢖͑͹ඞཁ࠷খݶͰࡁΉ w 4UBUFͷઃܭ΍֎քͱͷ௨৴͸υϝΠ ϯ஌ࣝͰ͋Γࣗ෼ͨͪͰఆٛ͢Δ w 4UBUF͕มΘΔͱ$POUBJOFS $PNQPOFOUT΋มΘΔͷͰෆ҆ఆ
  9. 'SPOUFOE 1SJNJUJWF$PNQPOFOUT -JCSBSZ $POUBJOFS$PNQPOFOUT 4UBUF 6* $PNQPOFOUT 8FC"1* #BDLFOE ࣗ෼Ͱܕఆٛ͢Δൣғ

    w جຊͱͳΔ8FC"1*΍3FBDUͷجຊ ίϯϙʔωϯτ͸UZQFTDSJQUMJC΍
 !UZQFTSFBDUʹఆٛࡁΈ w ϥΠϒϥϦ΋Ͱ͖ΔݶΓܕఆٛͷ͋Δ΋ ͷΛ࢖͏ w 6*$PNQPOFOUʹ͍ͭͯ͸QSPQTΛ্ ख͘ܧঝͨ͠ΓTUZMFEDPNQPOFOUT Λ࢖͑͹ඞཁ࠷খݶͰࡁΉ w 4UBUFͷઃܭ΍֎քͱͷ௨৴͸υϝΠ ϯ஌ࣝͰ͋Γࣗ෼ͨͪͰఆٛ͢Δ w 4UBUF͕มΘΔͱ$POUBJOFS $PNQPOFOUT΋มΘΔͷͰෆ҆ఆ
 ˠ)PPLTΛ࢖͑͹৑௕ͳܕఆٛ͸ෆཁ