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

GraphQL実践ノウハウv2

sonatard
January 30, 2024

 GraphQL実践ノウハウv2

GraphQL実践ノウハウ
https://speakerdeck.com/sonatard/graphql-knowhow

宣言的UIの状態管理とアーキテクチャSwiftUIとGraphQLによる実践
https://speakerdeck.com/sonatard/swiftui-graphql

GraphQLの誤解
https://speakerdeck.com/sonatard/rethinking-graphql

sonatard

January 30, 2024
Tweet

More Decks by sonatard

Other Decks in Programming

Transcript

  1. 9 ෳ਺ͷ(SBQI2-"1*ΤϯυϙΠϯτͷ࣮ߦ w ύλʔϯ w ಺෦"1*Ͱऔಘͨ͠৘ใΛݩʹ֎෦"1*Λ࣮ߦ͢Δ ֎෦"1* ಺෦"1* 8FCϖʔδ நબ঎඼Ұཡ

    QSPEVDU@JEΛऔಘ ঎඼৘ใ { "raffles": [ {“id": 1, "name": “நબA", “product_id": 100}, {"id": 2, "name": "நબB", “product_id": 200}, {"id": 3, “name”: “நબC", “product_id”: 300} ] } products([100, 200, 300]) { "products": [ {“id": 100, "name": “঎඼A", “quantity”: 10}, {"id": 200, "name": "঎඼B", “quantity”: 20}, {"id": 300, “name": “঎඼C”, "quantity": 30} ] } ΫϥΠΞϯτʹɺ಺෦"1*ͷ݁ՌΛ੔ܗͯ͠ ֎෦"1*ʹ౉͢ϩδοΫ͕૿͑Δ
  2. 10 ෳ਺ͷ(SBQI2-"1*ΤϯυϙΠϯτͷ࣮ߦ w ղܾࡦ w ֎෦"1*Λ಺෦"1*Ͱϥοϓ͢Δ ֎෦"1* ಺෦"1* 8FCϖʔδ products([100,

    200, 300]) { "raffles": [ {“id": 1, "name": “நબA”, “product_name”: “঎඼A” “quantity”: 10}, {“id": 2, "name": “நબB”, “product_name”: “঎඼B” “quantity”: 20}, {“id": 3, "name": “நબC”, “product_name”: “঎඼C” “quantity”: 30}, ] } 8FCϖʔδ͸಺෦"1*ʹϦΫΤετ͚ͩૹΔ நબ঎඼Ұཡ ঎඼৘ใ
  3. 11 εΩʔϚઃܭόοΫΤϯυ͔Βͷ֎෦"1*ϦΫΤετͷ஫ҙ఺ w ղܾࡦͷ໰୊఺ w ҎԼͷΑ͏ʹϥοϓͨ͠εΩʔϚΛఆٛ͢Δͱɺ֎෦"1*ͷ੍໿Λ಺෦"1*͕ड͚Δ͜ͱ ʹͳΔ type RaffleProduct {

    id: ID! name: String! productName: String! productQuantity: String! } extend type Query { raffleProducts: RaffleProductConnection! } query RaffleProducts { raffleProducts { nodes { id name } } } நબ঎඼*%ͱநબ໊ OBNF ͚ͩΛऔಘ͢Ε͹͍͍ ৔߹ʹ΋ɺ֎෦"1*΁ͷΞΫηεΛͯ͠͠·͏ ύϑΥʔϚϯεͷ௿Լ ҙຯ΋ͳ͘"1*3BUF-JNJUʹ͔͔Δ ຊ൪ɺ"1*ςετ؀ڥʹӨڹ͕ग़Δ
  4. 12 εΩʔϚઃܭόοΫΤϯυ͔Βͷ֎෦"1*ϦΫΤετͷ஫ҙ఺ w ಺෦"1*ͷ֎෦"1*ͷӨڹͷղফ w ղܾࡦ֎෦"1*ͷϑΟʔϧυ͸SFTPMWFSΛੜ੒͢Δ type RaffleProduct { id:

    ID! name: String! # resolverΛੜ੒ͯ͠ɺfield͕ࢀর͞Εͳ͚Ε͹࣮ߦ͞Εͳ͍Α͏ʹ͢Δ productName: String! @goField(forceResolver: true) productQuantity: String! @goField(forceResolver: true) } extend type Query { raffleProducts: RaffleProductConnection! } 3FTPMWFSΛੜ੒ͯ͠ɺ fi FME͕ࢀর͞Εͳ͚Ε͹࣮ߦ͞Εͳ͍Α͏ʹ͢Δ ͔͜͠͠Εͩͱɺ౓ͷ2VFSZͰQSPEVDU/BNFͱQSPEVDU2VBOUJUZͷ྆ํͷࢀর ͕͋Δ৔߹ʹɺճͷ֎෦"1*΁ͷϦΫΤετ͕ඈΜͰ͠·͏
  5. 13 εΩʔϚઃܭόοΫΤϯυ͔Βͷ֎෦"1*ϦΫΤετͷ஫ҙ఺ w ಺෦"1*ͷ֎෦"1*ͷӨڹͷղফ w ղܾࡦ಺෦"1*ͱ֎෦"1*ͷUZQFΛ෼཭͢Δ # ಺෦API type RaffleProduct

    { id: ID! name: String! # ֎෦API product: Product! @goField(forceResolver: true) } # ֎෦API type Product { id: ID! name: String! quantity: String! }
  6. 14 εΩʔϚઃܭόοΫΤϯυ͔Βͷ֎෦"1*ϦΫΤετͷ஫ҙ఺ w ಺෦"1*ͷ֎෦"1*ͷӨڹͷղফ w ղܾࡦ಺෦"1*ͱ֎෦"1*ͷUZQFΛ෼཭͢Δ query RaffleProducts { raffleProducts

    { nodes { id name } } } ಺෦ͷ"1*͚ͩΞΫηε͢Δ৔߹͸֎෦"1*ͷӨڹ Λड͚ͳ͘ͳΔ 1SPEVDU͕ඞཁͳ৔߹͚ͩ֎෦"1*ʹϦΫΤετ ౤͛ΔΑ͏ʹͳΔ query RaffleProducts { raffleProducts { nodes { id name product { name quantity } } } }
  7. 18 Ϛϧνςφϯτͷ"1*ઃܭ w ϚϧνςφϯτΛεΩʔϚͱͯ͠Ͳ͏දݱ͢Δ͔ʁ type Query { products: [Product!]! users:

    [User!]! } ύλʔϯεΩʔϚͷϧʔτʹ7JFXFSΛ഑ஔ ύλʔϯεΩʔϚͷϧʔτΛ5FOBOUͱͯ͠ѻ͏ type Query { adminViewer: Admin! tenantAdminViewer: TenantAdmin! } type Admin { tenants: [Tenant!]! } type TenantAdmin { tenant: Tenant! } type Tenant { id: ID! name: String! products: [Product!]! users: [User!]! }
  8. 19 Ϛϧνςφϯτͷ"1*ઃܭ w ύλʔϯεΩʔϚͷϧʔτʹ7JFXFSΛ഑ஔ w 5FOBOUΦϒδΣΫτͰ5FOBOUͷείʔϓΛදݱ͢Δ w γϯϓϧͰࣗવ w ͔͠͠΄ͱΜͲͷϢʔεέʔε͕UFOBOU"ENJO7JFXFSͩͱͨ͠

    Βɺඞͣ5FOBOU"ENJO΍5FOBOUΛܦ༝͠ͳ͍ͱଞͷUZQFʹΞΫ ηεͰ͖ͳ͍ͷͰ2VFSZ͕৑௕ type Query { adminViewer: Admin! tenantAdminViewer: TenantAdmin! } type Admin { tenants: [Tenant!]! } type TenantAdmin { tenant: Tenant! } type Tenant { id: ID! name: String! products: [Product!]! users: [User!]! } 5FOBOU" 6TFS" 6TFS" 1SPEVDU" 1SPEVDU"
  9. 20 Ϛϧνςφϯτͷ"1*ઃܭ w ύλʔϯεΩʔϚͷϧʔτΛ5FOBOUͱͯ͠ѻ͏ w εΩʔϚͦͷ΋ͷͰ5FOBOUͷείʔϓΛදݱ͢Δɻ w UFOBOU"ENJO7JFXFSͱͯ͠͸ɺ2VFSZ͸ͱͯ΋؆ܿʹॻ͚Δ w BENJO7JFXFSͷͨΊʹUFOBOUT͕༻ҙ͞Ε͍ͯΔ͕ɺ

    UFOBOU"ENJO7JFXFSʹ͸ෆཁͰ͋Δ type Query { products: [Product!]! users: [User!]! tenants: [Tenant!]! } 5FOBOU" 6TFS" 6TFS" 1SPEVDU" 1SPEVDU"
  10. 22 Ϛϧνςφϯτͷ"1*ઃܭ w ྫ ɹ಺෦"1*ͱެ։"1*ͰεΩʔϚΛ෼ׂ͢Δ type Query { products: [Product!]!

    users: [User!]! } ಺෦"1*εΩʔϚͷϧʔτʹ5FOBOUTΛ഑ஔ ֎෦"1*εΩʔϚͷϧʔτΛ5FOBOUͱͯ͠ѻ͏ type Query { adminViewer: Admin! tenantAdminViewer: TenantAdmin! } type Admin { tenants: [Tenant!]! } type TenantAdmin { tenant: Tenant! } type Tenant { id: ID! name: String! products: [Product!]! users: [User!]! } ಺෦"1*Ͱ͸BENJO7JFXFSͷϢʔεέʔε͕গͳ͚ Ε͹ɺ2VFSZ͕৑௕ͳ໰୊ͷଟ͘͸ղܾ͢Δ
  11. 23 Ϛϧνςφϯτͷ"1*ઃܭ w ྫ "ENJO7JFXFS"1*ͱUFOBOU"ENJO7JFXFS"1*ͰεΩʔϚΛ෼ׂ͢Δ type Query { products: [Product!]!

    users: [User!]! } "ENJO7JFXFS"1* εΩʔϚͷϧʔτʹ5FOBOUTΛ഑ஔ UFOBOU"ENJO7JFXFS"1* εΩʔϚͷϧʔτΛ5FOBOUͱͯ͠ѻ͏ type Query { tenants: [Tenant!]! tenant(id: ID!): Tenant! } type Tenant { id: ID! name: String! products: [Product!]! users: [User!]! } λʔήοτ͝ͱʹ"1*Λఆٛ͢Δ͜ͱͰɺεΩʔϚ Λ࠷খݶʹ͢Δ͜ͱ͕Ͱ͖Δ
  12. 24 Ϛϧνςφϯτͷ"1*ઃܭ w ෼ׂͷσϝϦοτ w ؅ཧର৅͕૿͑Δ w ઃܭͷݕ౼Օॴ͕૿͑Δ w εΩʔϚ͸෼͚͕ͨɺαʔό͸෼͚Δͷ͔ʁ

    w αʔό෼͚Δ৔߹͸ɺ6TFDBTFͷ࠶ར༻͸Ͱ͖ͳ͍͕Ͳ͏͢Δ͔ʁ w ͳͲ w ෼ׂ͸ɺ໰୊఺Λղܾ͢Δखஈͱͯ҆͠қʹબͼ͕ͪͳͷͰ஫ҙ͕ඞཁ w ͜ͷεϥΠυͰ࿩ͨ͠Α͏ͳҰൠ࿦Ͱ൑அ͢ΔͷͰ͸ͳ͘ɺࣗ෼͕ͨͪຊ౰ʹͦͷ՝ ୊͕ଘࡏ͢Δͷ͔Λߟ͔͑ͯΒ෼ׂ͢Δ͜ͱ͕େ੾ w 2VFSZ͕৑௕ͱͳΔͱ͍͏͕ɺͦΕʹΑͬͯ։ൃੜ࢈ੑ͸མͪΔͷ͔ʁ
  13. 28 / ͱ%BUB-PBEFS w நબ঎඼Ұཡ͔Β঎඼৘ใΛऔಘ͢Δ(SBQI2- ಺෦"1* 8FCϖʔδ query RaffleProducts {

    raffleProducts { nodes { id name product { name quantity } } } } %# TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE / ͕ൃੜ͢Δ
  14. 29 / ͱ%BUB-PBEFS ಺෦"1* 8FCϖʔδ { "raffles": [ {“id": 1,

    "name": “நબA", “product_id": 100}, {"id": 2, "name": "நબB", “product_id": 200}, {"id": 3, “name”: “நબC", “product_id”: 300} ] } SB ff l F@QSPEVDUT QSPEVDUT JET   / ͕ൃੜ͠ͳ͍ w நબ঎඼Ұཡ͔Β঎඼৘ใΛऔಘ͢Δ3&45
  15. 30 / ͱ%BUB-PBEFS w நબ঎඼Ұཡ͔Β঎඼৘ใΛऔಘ͢Δ3&45 ಺෦"1* 8FCϖʔδ { "raffles": [

    {“id": 1, "name": “நબA", “product_id": 100}, {"id": 2, "name": "நબB", “product_id": 200}, {"id": 3, “name”: “நબC", “product_id”: 300} ] } SB ff l F@QSPEVDUT QSPEVDUT QSPEVDUT QSPEVDUT / ͕ൃੜ͢Δ
  16. 32 / ͱ%BUB-PBEFS w ࣍ʹ3&45ͰQSPEVDUT JETΛఆ͍ٛͯͨ͠৔߹ͱ(SBQI2-ͷ/ ͷൺֱ ಺෦"1* 8FCϖʔδ SB

    ff l F@QSPEVDUT QSPEVDUT JET   ಺෦"1* 8FCϖʔδ query RaffleProducts { raffleProducts { nodes { id name product { name quantity } } } } %# TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE %# TFMFDU GSPNQSPEVDU XIFSFJEJO    TFMFDU GSPNQSPEVDUXIFSFJE
  17. 33 / ͱ%BUB-PBEFS w ࣍ʹ3&45ͰQSPEVDUT JETΛఆ͍ٛͯͨ͠৔߹ͱ(SBQI2-ͷ/ ͷൺֱ ಺෦"1* 8FCϖʔδ SB

    ff l F@QSPEVDUT QSPEVDUT JET   ಺෦"1* 8FCϖʔδ query RaffleProducts { raffleProducts { nodes { id name product { name quantity } } } } %# TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE %# TFMFDU GSPNQSPEVDU XIFSFJEJO    NT NT  TFMFDU GSPNQSPEVDUXIFSFJE NT  NT  ߹ܭ NT ߹ܭ NT
  18. 34 / ͱ%BUB-PBEFS w ݁Ռ w / ͕ͳ͍3&45NT w /

    ͕͋Δ(SBQI2-NT w / ͸՝୊Ͱ͸ͳ͘ɺ/ ʹΑΓͲ͏͍͏՝୊͕͋ΓɺԿΛղܾ͍͔ͨ͠Λߟ͑Δ͜ͱ͕ େ੾Ͱ͢ɻ w ૝૾͍ͯͨ͠՝୊͕ʮ3&45͔Β(SBQI2-Ҡߦ࣌ʹ/ ͰύϑΥʔϚϯε͕ѱԽ͢Δͷ Ͱղܾ͍ͨ͠ʯͱ͍͏΋ͷͩͱͨ͠Βɺ͜ͷྫͰ͸3&45ΑΓ͔͸଎͘ͳ͍ͬͯΔͷͰ ղܾ͸ෆཁͱ͍͏͜ͱʹͳΓ·͢ɻ w ͳΜͱͳ͘ʮ/ ͸Α͘ͳ͍ͱݴΘΕ͍ͯΔ͔͔Βʯʮ/ ͸ແବͳॲཧ͔ͩΒʯͱ͍ ͏ཧ༝Ͱղܾ͢Δͷ͸ةݥͰ͢ɻ
  19. 35 / ͱ%BUB-PBEFS w ࠷ޙʹ(SBQI2- %BUB-PBEFSΛߟ͑ͯΈ·͢ w ҎԼͷNT͔Β଎͘ͳΔͰ͠ΐ͏͔ʁ ಺෦"1* 8FCϖʔδ

    query RaffleProducts { raffleProducts { nodes { id name product { name quantity } } } } %# TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE NT  TFMFDU GSPNQSPEVDUXIFSFJE NT  ߹ܭ NT
  20. 36 / ͱ%BUB-PBEFS w ࠷ޙʹ(SBQI2- %BUB-PBEFSΛߟ͑ͯΈ·͢ w %BUB-PBEFSΛಋೖͨ͜͠ͱͰɺ/ ͕ղܾͯ͠଎͘ͳΓ·ͨ͠ʂ w

    ຊ౰Ͱ͠ΐ͏͔ʁ ಺෦"1* 8FCϖʔδ query RaffleProducts { raffleProducts { nodes { id name product { name quantity } } } } %# NT  ߹ܭ NT TFMFDU GSPNQSPEVDU XIFSFJEJO    NT 
  21. 37 / ͱ%BUB-PBEFS w %BUB-PBEFSͷ࣮૷ʹΑͬͯ͸଴ػ͕࣌ؒઃఆ͞Ε͓ͯΓɺͦͷؒͷϦΫΤετΛ·ͱΊΔ ͜ͱͰ/ Λղফ͠·͢ɻ w ΋͠଴ػ͕࣌ؒNTͩͱͨ͠ΒҎԼͷΑ͏ʹͳΓ·͢ w

    ݩͷNTΑΓ஗͘ͳ͍ͬͯΔ͔΋͠Ε·ͤΜɻ ಺෦"1* 8FCϖʔδ query RaffleProducts { raffleProducts { nodes { id name product { name quantity } } } } %# NT  ߹ܭ NT TFMFDU GSPNQSPEVDU XIFSFJEJO    NT  ଴ػ࣌ؒ NT
  22. 38 / ͱ%BUB-PBEFS w ·ͨ΋͠଴ػ͕࣌ؒNTͰ%#΁ͷΞΫηε͕όονॲཧ͞Εͣ଴ػ͚࣌ؒͩ஗͘ͳ͍ͬͯ ΔՄೳੑ΋͋Γ·͢ɻ ಺෦"1* 8FCϖʔδ query RaffleProducts

    { raffleProducts { nodes { id name product { name quantity } } } } %# NT  ߹ܭ NT ଴ػ࣌ؒ NT TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE NT  TFMFDU GSPNQSPEVDUXIFSFJE
  23. 39 / ͱ%BUB-PBEFS w ·ͨͦ΋ͦ΋(SBQI2-ͷSFTPMWFS͸ฒߦ࣮ߦ͞Ε·͢ɻ w ࠓ·Ͱ͸આ໌ͷศ্ٓNT ͱ͖ͯ͠·͕ͨ͠ɺͭฒߦʹಈ͚͹͔͔Δ࣌ؒ͸NT Ͱ͢ɻ w

    ͦͷ৔߹଴ػ͚࣌ؒͩ஗͘ͳ͍ͬͯ·͢ɻ ಺෦"1* 8FCϖʔδ query RaffleProducts { raffleProducts { nodes { id name product { name quantity } } } } ֎෦"1* NT  ߹ܭ NT ଴ػ࣌ؒ NT NT  TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE
  24. 40 / ͱ%BUB-PBEFS w ͞Βʹ֎෦"1*ʹΞΫηε͍ͯ͠Δ৔߹ʹɺ·ͱΊͯऔಘ͢Δ"1*͕஗͍͔΋͠Ε·ͤΜɻ ಺෦"1* 8FCϖʔδ ֎෦"1* NT 

    ߹ܭ NT NT QSPEVDUT JET   ಺෦"1* 8FCϖʔδ ֎෦"1* NT  ߹ܭ NT NT QSPEVDUT QSPEVDUT QSPEVDUT ଴ػ࣌ؒ NT /  / ͷղফ
  25. 41 / ͱ%BUB-PBEFS w Ҏ্ͷΑ͏ʹ%BUB-PBEFSΛಋೖ͢Ε͹଎͘ͳΔͱ͍͏Θ͚Ͱ͸ͳ͘ɺඞͣܭଌͱ5SBDFͷ ֬ೝ͕ඞཁͱͳΓ·͢ɻ w ֬ೝࣄ߲ w /

    ͸ຊ౰ʹ·ͱΊΒΕ͍ͯΔ͔ʁ w όονॲཧͨ͜͠ͱͰ஗͘ͳ͍ͬͯͳ͍͔ʁ w ଴ػ࣌ؒ΋ؚΊͨ߹ܭͷ࣌ؒ͸଎͘ͳ͍ͬͯΔ͔ʁ w ΋֬͠ೝͰ͖͍ͯͳ͍ͱͨ͠ΒɺύϑΥʔϚϯεΛѱԽ͍ͤͯ͞ΔՄೳੑ͕͋Γ·͢ɻ w ͦͯ֬͠ೝͰ͖͍ͯͳ͍ͷͰ͋Ε͹ɺ%BUB-PBEFSͷಋೖ͸ૣ͗͢Δ࠷దԽ͔΋͠Ε·ͤΜ w 3PC1JLFT3VMFTPG1SPHSBNNJOHDPNQMFYJUZ w IUUQTEFWUPTPOBUBSESPCQJLFTSVMFTPGQSPHSBNNJOHDPNQMFYJUZEO
  26. 42 / ͱ%BUB-PBEFS w ͔͠͠/ ͷ໰୊͸ύϑΥʔϚϯε͚ͩͰ͸͋Γ·ͤΜ w $16ɺ%#࢖༻཰ͷ૿Ճɺ$16ɺ%#ͷඅ༻ w ֎෦"1*3BUF-JNJUͷফඅͳͲ

    w ্هͷ໰୊Λղܾ͢ΔͨΊʹ%BUB-PBEFSΛಋೖ͢ΔͷͰ͋Ε͹ɺύϑΥʔϚϯε͕མͪͯ ΋ಋೖ͢ΔՁ஋͕͋Γ·͢ɻ w ͦͷͨΊඞͣ໨తΛ໌֬ʹͯ͠ɺ໨తΛղܾ͢ΔͨΊʹ%BUB-PBEFSΛར༻͠·͠ΐ͏ɻ w ͋ͱ͸%BUB-PBEFSͷ࣮૷ɺอकίετͱͷ݉Ͷ߹͍ͰɺνʔϜʹΑͬͯํ਑ΛܾΊΔͱྑ ͍ͱࢥ͍·͢ɻ w %BUB-PBEFSͷ࣮૷Λࣗಈతʹૠೖ͢Δ࢓૊Έ͕͋ΔͷͰɺ࣮૷ɺอकίετ͸ͳͷ Ͱɺඞͣ%BUB-PBEFSΛಋೖ͢Δ w සग़͢ΔέʔεͰݕূͨ͠ͱ͜ΖύϑΥʔϚϯεͷ޲্͕֬ೝͰ͖ͨͷͰɺඞͣ %BUB-PBEFSΛಋೖ͢Δ w %#͕εέʔϧΞ΢τ͠ͳ͍ͷͰෛՙΛؾʹͯ͠ɺඞͣ%BUB-PBEFSΛಋೖ͢Δ
  27. 43 / ͱ%BUB-PBEFS w 4UBDLࣾͷ%BUB-PBEFSͷํ਑ w %BUB-PBEFS͸ɺجຊతʹ͸࣮૷͠·ͤΜ w HRMHFOͰ͸%BUB-PBEFSͷ࣮૷ίετͱϝϯςίετ͕͋ΔͨΊɺ͜ΕΛճආ͠·͢ w

    νʔϜͱͯ͠௨ৗͷ։ൃϑϩʔͰߟ͑Δ͜ͱ͸࠷௿ݶʹͯ͠ɺػೳ։ൃʹूத͠·͢ w %BUB-PBEFSΛ࣮૷͔ͨ͠Βʹ͸ɺ5SBDFΛݟͯόονॲཧͷ࣮ݱΛ֬ೝ͠ͳ͚Ε͹ͳΓ·ͤΜ͕ɺͦͷίετΛ ճආ͠·͢ w ܦӦ൑அͱͯ͠ɺࠓ͸αʔόίετΑΓΤϯδχΞϦιʔε͕େ੾Ͱ͢ɻͦͷͨΊαʔόίετΛ෷͍·͢ɻ w $16ͱ%#ͷෛՙ w $MPVE3VOͱ4QBOOFS͕εέʔϧΞ΢τ͢ΔͨΊෛՙ͸ؾʹ͍ͯ͠·ͤΜ w $16ͱ%#ͷඅ༻ w අ༻͸ଟ͘ͷϢʔβ͕ར༻͢Δ·ͰӨڹ͕ͳ͍ͷͰ༏ઌ౓ΛԼ͍͛ͯ·͢ w අ༻͕େ͖͘ͳͬͨ࣌఺Ͱɺ%BUB-PBEFSͷσϑΥϧτ࣮૷Λ࠶ݕ౼͠·͢ w ֎෦"1*3BUF-JNJUͷӨڹ w దٓݕ౼ͯ͠%BUB-PBEFSΛಋೖ͍ͯ͠·͢ɻաڈʹ͸౓͚ͩ͋Γ·ͨ͠ɻ w 69ʹ༩͑ΔӨڹ͕͋Δ৔߹ w ࣮ࡍʹαʔϏεΛར༻͍ͯͯ͠ੑೳͷ໰୊Λײ͡Δ৔߹ʹಋೖͷݕ౼Λ͠·͢ w աڈʹ໰୊ʹͳͬͨ͜ͱ͸͋Γ·ͤΜ
  28. 46 ެ։"1*ͷεΩʔϚઃܭ1FSNJTTJPO w 1FSNJTTJPO͸ೝূͨ͠τʔΫϯʹؚ·Ε͍ͯ·͢ɻ w ͜ͷ৔߹͸3PMFͰ੍ޚ͢ΔͷͰ͸ͳ͘ɺڐՄ͍ͨ͠৔߹͸3PMFʹ1FSNJTTJPOΛ෇༩͠· ͢ɻ w 4UBDLࣾͰ͸3PMFͱ1FSNJTTJPOͷ؅ཧ͸$MFSLΛར༻͍ͯ͠·͢ɻ type

    Order @permission(permissions: ["order:read", "order:write"]) { id: ID! @goField(forceResolver: true) cancelledAt: DateTime note: String! } type Mutation { orderCreate(input: OrderCreateInput!): OrderCreatePayload! @permission(permissions: ["order:write"]) }
  29. 48 34$ͱ(SBQI2- w 34$ 3FBDU4FSWFS$PNQPOFOU ͷొ৔Ͱ(SBQI2-͸ͲͷΑ͏ʹӨڹΛड͚Δ͔ʁ w 3&45͔Βͷྺ࢙ͰৼΓฦΓ·͢ 3&45"1* 8FCϖʔδ

    SB ff l F@QSPEVDUT QSPEVDUT JET   %# TFMFDU GSPNQSPEVDU XIFSFJEJO    3&45 ΢ΥʔλʔϑΥʔϧ໰୊͕ى͖Δ SB ffl F@QSPEVDUTΛऔಘ͔ͯ͠Βɺ࣍ʹQSPEVDUTΛ౤͛Δඞཁ͕͋Δ ΫϥΠΞϯτͱαʔόͰ͸෺ཧతͳڑ཭͕͋Γ஗͍
  30. 49 34$ͱ(SBQI2- w ΢ΥʔλʔϑΥʔϧΛղܾ͢ΔͨΊʹ(SBQI2-Ͱ͸ɺ2VFSZΛαʔόʹ౤͛ͯόοΫΤϯ υͰղܾ͢Δ (SBQI2-"1* 8FCϖʔδ query RaffleProducts {

    raffleProducts { nodes { id name product { name quantity } } } } %# TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNQSPEVDUXIFSFJE TFMFDU GSPNSB ffl F@QSPEVDU ΢ΥʔλʔϑΥʔϧʹΑΔύϑΥʔϚϯεͷ໰୊͸ղܾͨ͠ ΢ΥʔλʔϑΥʔϧ͕ͳ͘ͳͬͨΘ͚Ͱ͸ͳ͍͕ɺ"1*αʔόͱ%#ͷؒͳͷ Ͱ෺ཧతڑ཭͕ۙ͘ɺ3&45ͱൺֱͯ͠Өڹ͕খ͍͞
  31. 50 34$ͱ(SBQI2- w ίϯϙʔωϯτʹ͓͚Δ΢ΥʔλʔϑΥʔϧ໰୊ w औಘ͢Δ஋͸ՄೳͳݶΓର৅ίϯϙʔωϯτʹఆ͍ٛͨ͠ w $PMPDBUJPO (SBQI2-"1* 3B

    ffl F1SPEVDU $PNQPOFOU 1SPEVDU $PNQPOFOU (FU3B ffl F (FU1SPEVDU    3B ffl F1SPEVDU$PNQPOFOUͷ (FU3B ffl F͕ऴΘΓ࣍ୈ 1SPEVDU$PNQPOFOUΛඳը 2VFSZΛ$PNQPOFOUʹ $PMPDBUJPO͢Δ͜ͱͰɺ ϦΫΤετ͕෼ׂ͞Εͯ (SBQI2-ͷϝϦοτ͕ͳ͘ͳΔ
  32. 51 34$ͱ(SBQI2- w $PMPDBUJPOʹΑΔ΢ΥʔλʔϑΥʔϧ໰୊ͷղফ w VTF#BDLHSPVOE2VFSZɺVTF'SBHNFOUɺ4VTQFOTFɺEFGFSʹΑΔରԠ (SBQI2-"1* 3B ffl F1SPEVDU

    $PNQPOFOU 1SPEVDU $PNQPOFOU VTF#BDLHSPVOE2VFSZ (FU3B ffl F1SPEVDU     2VFSZʹEFGFSEJSFDUJWFΛࢦఆ VTF'SBHNFOUͰ ݁Ռ͕औಘͰ͖ͳ͚Ε͹ 4VTQFOE 3FMBZ͸ରԠͰ͖͍ͯΔ͕ ଞͷ(SBQI2-ΫϥΠΞϯτ͸ ௥͍͚͍ͭͯͳ͍ʁ "QPMMP͸ͰରԠ༧ఆ ରԠ·Ͱʹ਺೥͔͔Δ΄Ͳ ΫϥΠΞϯτͷෳࡶʹͳ͍ͬͯΔ ཧ૝తͳঢ়ଶΛ໨ࢦ͢ͳΒ 'SBHNFOU͝ͱͷΤϥʔϋϯυϦϯά ΋ߟ͑Δඞཁ͕Ͱͯ͘Δ (FU3B ffl F1SPEVDUͷ݁ՌΛ ଴ͨͣʹϨϯμϦϯά
  33. 52 34$ͱ(SBQI2- w 34$ w (SBQI2-ͷෳࡶ͕͞໰୊͕ͩɺαʔόʹίϯϙʔωϯτ͕͋Ε͹(SBQI2-͸ෆཁʹͳΓ ໰୊͸ղܾ͢Δɻ34$͸(SBQI2-ͷSFTPMWFSͷΑ͏ͳ΋ͷʹͳΔɻ 3B ffl F1SPEVDU

    $PNQPOFOU 1SPEVDU $PNQPOFOU %# PS "1* TFMFDU GSPNSB ffl F@QSPEVDU TFMFDU GSPNQSPEVDU XIFSFJEJO    3B ffl F1SPEVDU$PNQPOFOUͷ (FU3B ffl F͕ऴΘΓ࣍ୈ 1SPEVDU$PNQPOFOUΛඳը αʔό 34$ʹΑΓαʔό͔Βڑ཭͕͍ۙ%#ʹ ΞΫηε͢Δ ΢ΥʔλʔϑΥʔϧ͕ͳ͘ͳͬͨΘ͚Ͱ ͸ͳ͍͕ɺύϑΥʔϚϯεͷ໰୊͕ղܾ
  34. 53 34$ͱ(SBQI2- w (SBQI2-΍34$ͱͲͷΑ͏ʹ෇͖߹͏΂͖͔ʁ w ީิ(SBQI2-ΛׂΓ੾ͬͯ࢖͏ w ίϯϙʔωϯτͷ΢ΥʔλʔϑΥʔϧ໰୊ͷղܾΛఘΊͯ$PMPDBUJPO͚ͩΛ࣮ݱ͢Δ w ϧʔτͰVTF2VFSZΛͯ͠ίϯϙʔωϯτͰVTF'SBHNFOU

    w ͢΂ͯͷ݁Ռ͕ฦͬͯ͘Δ·Ͱɺ͢΂ͯͷίϯϙʔωϯτ͕දࣔ͞Εͳׂ͍͕Γ੾Δ w ީิ(SBQI2-Λਅ݋ʹ࢖͏ w 3FMBZΛ࠾༻ͯ͠'SBHNFOUΛཧ૝తͳঢ়ଶͰར༻͢Δ w VTF'SBHNFOUɺ4VTQFOTFɺEFGFS w αʔόͷεΩʔϚ΋جຊతʹ͸0QUJPOBMʹͯ͠ɺ2VFSZશମΛΤϥʔʹͤͣର৅ͷ 'JFME͚ͩΛΤϥʔʹ͢ΔͨΊʹSFRVJSFEEJSFDUJWFΛࢦఆ͢Δɻ
  35. 58 34$ͱ(SBQI2- w (SBQI2-ͷSFTPMWFSͱ34$ͷҧ͍ w (SBQI2- w σʔλߏ଄ʹରͯ͠ɺऔಘॲཧ͕࣮૷͞ΕΔ w 6*ͷมߋ͕͋ͬͨͱ͖ʹɺίϯϙʔωϯτ্ͷ2VFSZΛมߋ͢Δ

    w 34$ w ίϯϙʔωϯτͷ6*ߏ଄ʹରͯ͠ɺऔಘॲཧ͕࣮૷͞ΕΔ w 6*ͷมߋ͕͋ͬͨͱ͖ʹɺίϯϙʔωϯτ্Ͱऔಘॲཧͷ࣮૷ͷมߋΛ͢Δ
  36. 59 34$ͱ(SBQI2- w εΩʔϚͱͯ͠ͷརศੑ w (SBQI2- w 4DBMBSɺEJSFDUJWFͳͲ͸ศར w 34$

    3&45 w 0QFO"1*͸͋Δ͕རศੑ͸ྼΔ w ࠷ۙొ৔ͨ͠5ZQF4QFD͸εΩʔϚͷγϯϓϧ͞΍རศੑ͕(SBQI2-ʹ͍ۙͷͰ஫໨ ͍ͨ͠IUUQTUZQFTQFDJP
  37. 60 34$ͱ(SBQI2- w ΞϓϦ w (SBQI2- w (SBQI2-ΫϥΠΞϯτ͸֤छଘࡏͯ͠࠾༻Մೳ w "OESPJE

    +FUQBDL$PNQPTFF "QPMMP,PUMJO w J04 4XJGU6* "QPMMPJ04 w 'MVUUFSHSBQIRM@ fl VUUFSɺGFSSZ w 3FBDU/BUJWF3FMBZ w 34$ w "OESPJEɺJ04ɺ'MVUUFSͰ͸ར༻Ͱ͖ͳ͍ w 3FBDU/BUJWF&YQPͰରԠΛਐΊ͍ͯΔ