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. 1
    (SBQI2-࣮ફϊ΢ϋ΢W
    ೥ͦ͜࢖͍͜ͳ͢ʂ(SBQI2-࠷લઢ
    !TPOBUBSEͦͳଠ

    View full-size slide

  2. Stack CTO
    ͦͳଠ
    @sonatard

    View full-size slide

  3. 3
    גࣜձࣾ4UBDL

    View full-size slide

  4. 5
    ͸͡Ίʹ
    w 4UBDLͰ(SBQI2-Λ࣮ફ͖ͯͨ͠தͰͷࢼߦࡨޡͨ͠಺༰Λ঺հ͠·͢ɻ

    View full-size slide

  5. ෳ਺ͷ(SBQI2-"1*ΤϯυϙΠϯτͷ࣮ߦ
    όοΫΤϯυ͔Βͷ֎෦"1*ϦΫΤετͷ஫ҙ఺

    View full-size slide

  6. 7
    ෳ਺ͷ(SBQI2-"1*ΤϯυϙΠϯτͷ࣮ߦ
    w ྫ
    w ಺෦"1*ͱ֎෦"1*Λར༻ͯ͠ϖʔδΛߏ੒͢Δ
    ֎෦"1*
    ಺෦"1*
    8FCϖʔδ

    View full-size slide

  7. 8
    ෳ਺ͷ(SBQI2-"1*ΤϯυϙΠϯτͷ࣮ߦ
    w ύλʔϯ
    w ಺෦"1*ͷϨεϙϯεͱ֎෦"1*ͷϨεϙϯεʹӨڹ͕ͳ͍
    w ͜ͷͱ͖͸ɺෳ਺ͷ(SBQI2-"1*Λ࣮ߦͯ͠΋ɺ͞΄ͲΫϥΠΞϯτͷ࣮૷͸ෳࡶʹͳ
    Βͳ͍ͷͰɺಛʹؾʹ͠ͳͯ͘΋͍͍
    ֎෦"1*
    ಺෦"1*
    8FCϖʔδ

    View full-size slide

  8. 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*ʹ౉͢ϩδοΫ͕૿͑Δ

    View full-size slide

  9. 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*ʹϦΫΤετ͚ͩૹΔ
    நબ঎඼Ұཡ
    ঎඼৘ใ

    View full-size slide

  10. 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*ςετ؀ڥʹӨڹ͕ग़Δ

    View full-size slide

  11. 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*΁ͷϦΫΤετ͕ඈΜͰ͠·͏

    View full-size slide

  12. 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!
    }

    View full-size slide

  13. 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
    }
    }
    }
    }

    View full-size slide

  14. 15
    ෳ਺ͷ(SBQI2-"1*ΤϯυϙΠϯτͷ࣮ߦ
    εΩʔϚઃܭόοΫΤϯυ͔Βͷ֎෦"1*ϦΫΤετͷ஫ҙ఺
    w ·ͱΊ
    w ಺෦"1*Λ࣮ߦͨ݁͠ՌΛݩʹ֎෦"1*Λ࣮ߦ͢ΔͱɺΫϥΠΞϯτͷ࣮૷ͷίετ্͕
    ͕Δ
    w ղܾࡦ͸ɺ಺෦"1*Ͱ֎෦"1*Λϥοϓͯ͠ɺ಺෦"1*ͱ֎෦"1*ͷܕΛ෼཭͢Δ
    w ࣮૷ίετ্͕͕Δͱ͍ͬͯ΋ɺঢ়گ࣍ୈͰ͸ࠣࡉͳ໰୊ͳͷͰؾʹ͠ͳ͍͜ͱ΋େ੾

    View full-size slide

  15. Ϛϧνςφϯτͷ"1*εΩʔϚઃܭ

    View full-size slide

  16. 5FOBOU#
    17
    Ϛϧνςφϯτͷ"1*ઃܭ
    w Ϛϧνςφϯτͷ֓೦ਤ
    5FOBOU"
    6TFS"
    6TFS"
    1SPEVDU"
    1SPEVDU"
    6TFS#
    6TFS#
    1SPEVDU#
    1SPEVDU#

    View full-size slide

  17. 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!]!
    }

    View full-size slide

  18. 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"

    View full-size slide

  19. 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"

    View full-size slide

  20. 21
    Ϛϧνςφϯτͷ"1*ઃܭ
    w Ҏ্ͷΑ͏ʹτϨʔυΦϑ͕ଘࡏ͢Δ
    w εΩʔϚͷར༻ऀʹ࠷దͳํ๏Λબ୒͢Δ͜ͱ΋Ͱ͖Δ
    w ྫ
    ಺෦"1*ͱެ։"1*ͰεΩʔϚΛ෼ׂ͢Δ
    w ྫ
    "ENJO7JFXFS"1*ͱUFOBOU"ENJO7JFXFS"1*ͰεΩʔϚΛ෼ׂ͢Δ

    View full-size slide

  21. 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͕৑௕ͳ໰୊ͷଟ͘͸ղܾ͢Δ

    View full-size slide

  22. 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*Λఆٛ͢Δ͜ͱͰɺεΩʔϚ
    Λ࠷খݶʹ͢Δ͜ͱ͕Ͱ͖Δ

    View full-size slide

  23. 24
    Ϛϧνςφϯτͷ"1*ઃܭ
    w ෼ׂͷσϝϦοτ
    w ؅ཧର৅͕૿͑Δ
    w ઃܭͷݕ౼Օॴ͕૿͑Δ
    w εΩʔϚ͸෼͚͕ͨɺαʔό͸෼͚Δͷ͔ʁ
    w αʔό෼͚Δ৔߹͸ɺ6TFDBTFͷ࠶ར༻͸Ͱ͖ͳ͍͕Ͳ͏͢Δ͔ʁ
    w ͳͲ
    w ෼ׂ͸ɺ໰୊఺Λղܾ͢Δखஈͱͯ҆͠қʹબͼ͕ͪͳͷͰ஫ҙ͕ඞཁ
    w ͜ͷεϥΠυͰ࿩ͨ͠Α͏ͳҰൠ࿦Ͱ൑அ͢ΔͷͰ͸ͳ͘ɺࣗ෼͕ͨͪຊ౰ʹͦͷ՝
    ୊͕ଘࡏ͢Δͷ͔Λߟ͔͑ͯΒ෼ׂ͢Δ͜ͱ͕େ੾
    w 2VFSZ͕৑௕ͱͳΔͱ͍͏͕ɺͦΕʹΑͬͯ։ൃੜ࢈ੑ͸མͪΔͷ͔ʁ

    View full-size slide

  24. 25
    Ϛϧνςφϯτͷ"1*ઃܭ
    w ·ͱΊ
    w ͭͷεΩʔϚͰ͢΂ͯΛղܾ͠Α͏ͱࢥ͏ͱτϨʔυΦϑ͕ଘࡏ͢Δ
    w ໨తʹ߹ΘͤͯεΩʔϚΛ෼ׂ͢Δ͜ͱͰղܾͰ͖Δ
    w ͔͠͠෼ׂʹ͸ίετ͕൐͏ͷͰɺਖ਼͠͞ͷັྗ͚ͩʹऒ͔Εͯ҆қʹऔΓ૊·ͳ͍͜ͱ
    ͕େ੾
    w ෼ׂͤͣʹҰఆظؒաͯ͝͠ɺਏ͞Λ਎Λ΋ͬͯମײ͢Δ
    w ਏ͘ͳ͍ͳΒ෼ׂ͠ͳ͍

    View full-size slide

  25. /ͱ%BUBMPBEFS

    View full-size slide

  26. 27
    /ͱ%BUB-PBEFS
    w (SBQI2-Λ࢝ΊΔͱ3&45ͷࠒͱൺֱͯ͠/Λؾʹ͢Δ͜ͱ͕ଟ͍
    w ·ͣ͸3&45ͱൺֱͯ͠ɺ(SBQI2-Ͱ͸ͲͷΑ͏ʹ/͕૿Ճ͢Δ͔ߟ͑ͯΈΔ

    View full-size slide

  27. 28
    /ͱ%BUB-PBEFS
    w நબ঎඼Ұཡ͔Β঎඼৘ใΛऔಘ͢Δ(SBQI2-
    ಺෦"1*
    8FCϖʔδ
    query RaffleProducts {
    raffleProducts {
    nodes {
    id
    name
    product {
    name
    quantity
    }
    }
    }
    }
    %#
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE
    /͕ൃੜ͢Δ

    View full-size slide

  28. 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

    View full-size slide

  29. 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
    /͕ൃੜ͢Δ

    View full-size slide

  30. 31
    /ͱ%BUB-PBEFS
    w 3&45Ͱ͸ɺෳ਺ͷ*%Λड͚ͯ݁ՌΛฦ͢"1*Λఆ͍ٛͯ͠Ε͹/ΛճආͰ͖Δ
    w ΋͠3&45ͰQSPEVDUT JETͷΑ͏ͳ"1*Λఆ͍ٛͯ͠ͳ͔ͬͨͷͳΒɺ3&45Ͱ΋/͸
    ൃੜ͍ͯͨ͠͸ͣͰ(SBQI2-͔ͩΒͱ͍͏໰୊Ͱ͸͋Γ·ͤΜ

    View full-size slide

  31. 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
    }
    }
    }
    }
    %#
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE
    %#
    TFMFDUGSPNQSPEVDU
    XIFSFJEJO

    TFMFDUGSPNQSPEVDUXIFSFJE

    View full-size slide

  32. 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
    }
    }
    }
    }
    %#
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE
    %#
    TFMFDUGSPNQSPEVDU
    XIFSFJEJO

    NT
    NT
    TFMFDUGSPNQSPEVDUXIFSFJE
    NT
    NT
    ߹ܭ
    NT
    ߹ܭ
    NT

    View full-size slide

  33. 34
    /ͱ%BUB-PBEFS
    w ݁Ռ
    w /͕ͳ͍3&45NT
    w /͕͋Δ(SBQI2-NT
    w /͸՝୊Ͱ͸ͳ͘ɺ/ʹΑΓͲ͏͍͏՝୊͕͋ΓɺԿΛղܾ͍͔ͨ͠Λߟ͑Δ͜ͱ͕
    େ੾Ͱ͢ɻ
    w ૝૾͍ͯͨ͠՝୊͕ʮ3&45͔Β(SBQI2-Ҡߦ࣌ʹ/ͰύϑΥʔϚϯε͕ѱԽ͢Δͷ
    Ͱղܾ͍ͨ͠ʯͱ͍͏΋ͷͩͱͨ͠Βɺ͜ͷྫͰ͸3&45ΑΓ͔͸଎͘ͳ͍ͬͯΔͷͰ
    ղܾ͸ෆཁͱ͍͏͜ͱʹͳΓ·͢ɻ
    w ͳΜͱͳ͘ʮ/͸Α͘ͳ͍ͱݴΘΕ͍ͯΔ͔͔Βʯʮ/͸ແବͳॲཧ͔ͩΒʯͱ͍
    ͏ཧ༝Ͱղܾ͢Δͷ͸ةݥͰ͢ɻ

    View full-size slide

  34. 35
    /ͱ%BUB-PBEFS
    w ࠷ޙʹ(SBQI2-%BUB-PBEFSΛߟ͑ͯΈ·͢
    w ҎԼͷNT͔Β଎͘ͳΔͰ͠ΐ͏͔ʁ
    ಺෦"1*
    8FCϖʔδ
    query RaffleProducts {
    raffleProducts {
    nodes {
    id
    name
    product {
    name
    quantity
    }
    }
    }
    }
    %#
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE
    NT
    TFMFDUGSPNQSPEVDUXIFSFJE
    NT
    ߹ܭ
    NT

    View full-size slide

  35. 36
    /ͱ%BUB-PBEFS
    w ࠷ޙʹ(SBQI2-%BUB-PBEFSΛߟ͑ͯΈ·͢
    w %BUB-PBEFSΛಋೖͨ͜͠ͱͰɺ/͕ղܾͯ͠଎͘ͳΓ·ͨ͠ʂ
    w ຊ౰Ͱ͠ΐ͏͔ʁ
    ಺෦"1*
    8FCϖʔδ
    query RaffleProducts {
    raffleProducts {
    nodes {
    id
    name
    product {
    name
    quantity
    }
    }
    }
    }
    %#
    NT
    ߹ܭ
    NT
    TFMFDUGSPNQSPEVDU
    XIFSFJEJO

    NT

    View full-size slide

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

    NT
    ଴ػ࣌ؒ
    NT

    View full-size slide

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

    View full-size slide

  38. 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
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE

    View full-size slide

  39. 40
    /ͱ%BUB-PBEFS
    w ͞Βʹ֎෦"1*ʹΞΫηε͍ͯ͠Δ৔߹ʹɺ·ͱΊͯऔಘ͢Δ"1*͕஗͍͔΋͠Ε·ͤΜɻ
    ಺෦"1*
    8FCϖʔδ ֎෦"1*
    NT
    ߹ܭ
    NT
    NT
    QSPEVDUT JET
    ಺෦"1*
    8FCϖʔδ ֎෦"1*
    NT
    ߹ܭ
    NT
    NT
    QSPEVDUT
    QSPEVDUT
    QSPEVDUT
    ଴ػ࣌ؒ
    NT
    /
    /ͷղফ

    View full-size slide

  40. 41
    /ͱ%BUB-PBEFS
    w Ҏ্ͷΑ͏ʹ%BUB-PBEFSΛಋೖ͢Ε͹଎͘ͳΔͱ͍͏Θ͚Ͱ͸ͳ͘ɺඞͣܭଌͱ5SBDFͷ
    ֬ೝ͕ඞཁͱͳΓ·͢ɻ
    w ֬ೝࣄ߲
    w /͸ຊ౰ʹ·ͱΊΒΕ͍ͯΔ͔ʁ
    w όονॲཧͨ͜͠ͱͰ஗͘ͳ͍ͬͯͳ͍͔ʁ
    w ଴ػ࣌ؒ΋ؚΊͨ߹ܭͷ࣌ؒ͸଎͘ͳ͍ͬͯΔ͔ʁ
    w ΋֬͠ೝͰ͖͍ͯͳ͍ͱͨ͠ΒɺύϑΥʔϚϯεΛѱԽ͍ͤͯ͞ΔՄೳੑ͕͋Γ·͢ɻ
    w ͦͯ֬͠ೝͰ͖͍ͯͳ͍ͷͰ͋Ε͹ɺ%BUB-PBEFSͷಋೖ͸ૣ͗͢Δ࠷దԽ͔΋͠Ε·ͤΜ
    w 3PC1JLFT3VMFTPG1SPHSBNNJOHDPNQMFYJUZ
    w IUUQTEFWUPTPOBUBSESPCQJLFTSVMFTPGQSPHSBNNJOHDPNQMFYJUZEO

    View full-size slide

  41. 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Λಋೖ͢Δ

    View full-size slide

  42. 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 աڈʹ໰୊ʹͳͬͨ͜ͱ͸͋Γ·ͤΜ

    View full-size slide

  43. ެ։"1*ͷεΩʔϚઃܭ1FSNJTTJPO

    View full-size slide

  44. 45
    ެ։"1*ͷεΩʔϚઃܭ1FSNJTTJPO
    w (SBQI2-࣮ફϊ΢ϋ΢Ͱ͓࿩ͨ͠͠1FSNJTTJPOͱ͸ҟͳΔ΋ͷͰ͢ɻ
    w (JU)VCͷ1SJWBUF"DDFTT5PLFOͷΑ͏ͳ΋ͷͷ࣮૷Λ૝ఆ͍ͯ͠·͢ɻ

    View full-size slide

  45. 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"])
    }

    View full-size slide

  46. 34$ͱ(SBQI2-

    View full-size slide

  47. 48
    34$ͱ(SBQI2-
    w 34$ 3FBDU4FSWFS$PNQPOFOU
    ͷొ৔Ͱ(SBQI2-͸ͲͷΑ͏ʹӨڹΛड͚Δ͔ʁ
    w 3&45͔Βͷྺ࢙ͰৼΓฦΓ·͢
    3&45"1*
    8FCϖʔδ
    SB
    ff l
    F@QSPEVDUT
    QSPEVDUT JET
    %#
    TFMFDUGSPNQSPEVDU
    XIFSFJEJO

    3&45
    ΢ΥʔλʔϑΥʔϧ໰୊͕ى͖Δ
    SB
    ffl
    F@QSPEVDUTΛऔಘ͔ͯ͠Βɺ࣍ʹQSPEVDUTΛ౤͛Δඞཁ͕͋Δ
    ΫϥΠΞϯτͱαʔόͰ͸෺ཧతͳڑ཭͕͋Γ஗͍

    View full-size slide

  48. 49
    34$ͱ(SBQI2-
    w ΢ΥʔλʔϑΥʔϧΛղܾ͢ΔͨΊʹ(SBQI2-Ͱ͸ɺ2VFSZΛαʔόʹ౤͛ͯόοΫΤϯ
    υͰղܾ͢Δ
    (SBQI2-"1*
    8FCϖʔδ
    query RaffleProducts {
    raffleProducts {
    nodes {
    id
    name
    product {
    name
    quantity
    }
    }
    }
    }
    %#
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNQSPEVDUXIFSFJE
    TFMFDUGSPNSB
    ffl
    F@QSPEVDU
    ΢ΥʔλʔϑΥʔϧʹΑΔύϑΥʔϚϯεͷ໰୊͸ղܾͨ͠
    ΢ΥʔλʔϑΥʔϧ͕ͳ͘ͳͬͨΘ͚Ͱ͸ͳ͍͕ɺ"1*αʔόͱ%#ͷؒͳͷ
    Ͱ෺ཧతڑ཭͕ۙ͘ɺ3&45ͱൺֱͯ͠Өڹ͕খ͍͞

    View full-size slide

  49. 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-ͷϝϦοτ͕ͳ͘ͳΔ

    View full-size slide

  50. 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ͷ݁ՌΛ
    ଴ͨͣʹϨϯμϦϯά

    View full-size slide

  51. 52
    34$ͱ(SBQI2-
    w 34$
    w (SBQI2-ͷෳࡶ͕͞໰୊͕ͩɺαʔόʹίϯϙʔωϯτ͕͋Ε͹(SBQI2-͸ෆཁʹͳΓ
    ໰୊͸ղܾ͢Δɻ34$͸(SBQI2-ͷSFTPMWFSͷΑ͏ͳ΋ͷʹͳΔɻ
    3B
    ffl
    F1SPEVDU
    $PNQPOFOU
    1SPEVDU
    $PNQPOFOU
    %#
    PS
    "1*
    TFMFDUGSPNSB
    ffl
    F@QSPEVDU
    TFMFDUGSPNQSPEVDU
    XIFSFJEJO

    3B
    ffl
    F1SPEVDU$PNQPOFOUͷ
    (FU3B
    ffl
    F͕ऴΘΓ࣍ୈ
    1SPEVDU$PNQPOFOUΛඳը
    αʔό
    34$ʹΑΓαʔό͔Βڑ཭͕͍ۙ%#ʹ
    ΞΫηε͢Δ
    ΢ΥʔλʔϑΥʔϧ͕ͳ͘ͳͬͨΘ͚Ͱ
    ͸ͳ͍͕ɺύϑΥʔϚϯεͷ໰୊͕ղܾ

    View full-size slide

  52. 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Λࢦఆ͢Δɻ

    View full-size slide

  53. 54
    34$ͱ(SBQI2-
    w (SBQI2-΍34$ͱͲͷΑ͏ʹ෇͖߹͏΂͖͔ʁ
    w ީิ(SBQI2-TQFDͱ"QPMMPରԠΛ଴ͬͯ(SBQI2-Λਅ݋ʹ࢖͏
    w "QPMMPͷVTF'SBHNFOUɺ4VTQFOTFɺEFGFSͷରԠΛ଴ͭ
    w (SBQI2-TQFDͰ4FNBOUJD/PO/VMMͷ࢓༷͕ܾ·Γɺ"QPMMP͕࣮૷͢ΔͷΛ଴ͭ
    w αʔόͷεΩʔϚ΋جຊతʹ͸4FNBOUJD/PO/VMMʹͯ͠ɺ2VFSZશମΛΤϥʔʹ
    ͤͣର৅ͷ'JFME͚ͩΛΤϥʔʹ͢Δɻ
    w ͦΕ·Ͱ͸ީิͰ଴ػ

    View full-size slide

  54. 55
    34$ͱ(SBQI2-
    w (SBQI2-΍34$ͱͲͷΑ͏ʹ෇͖߹͏΂͖͔ʁ
    w ީิ34$Λ࠾༻͢Δ
    w 34$Λ࠾༻ͯ͠ɺ(SBQI2-'SBHNFOUͷ೉͔͠͞Β཭ΕΔ
    w 34$͕ൃల్্ͳͨΊݱ࣌఺ͩͱ34$Λ௥͍੾ΕΔύϫʔ͕ඞཁ

    View full-size slide

  55. 56
    34$ͱ(SBQI2-
    w (SBQI2-΍34$ͱͲͷΑ͏ʹ෇͖߹͏΂͖͔ʁ
    w ύϑΥʔϚϯε͕՝୊͸ͳ͘ɺػೳ։ൃʹूத͚ͨ͠Ε͹ީิ
    w ඞཁʹԠͯ͡ީิ
    w ύϑΥʔϚϯεʹ՝୊͕͋Γɺ3FMBZΛ࢖͍͜ͳͤΕ͹ީิ
    w ύϑΥʔϚϯεʹ՝୊͕͋Γɺ34$Λૣ͔͘Β௅ઓ͍ͨ͠৔߹͸ީิ

    View full-size slide

  56. 57
    34$ͱ(SBQI2-
    w ࠷ޙʹ34$ͱ(SBQI2-ͷҧ͍Λൺֱ͠·͢

    View full-size slide

  57. 58
    34$ͱ(SBQI2-
    w (SBQI2-ͷSFTPMWFSͱ34$ͷҧ͍
    w (SBQI2-
    w σʔλߏ଄ʹରͯ͠ɺऔಘॲཧ͕࣮૷͞ΕΔ
    w 6*ͷมߋ͕͋ͬͨͱ͖ʹɺίϯϙʔωϯτ্ͷ2VFSZΛมߋ͢Δ
    w 34$
    w ίϯϙʔωϯτͷ6*ߏ଄ʹରͯ͠ɺऔಘॲཧ͕࣮૷͞ΕΔ
    w 6*ͷมߋ͕͋ͬͨͱ͖ʹɺίϯϙʔωϯτ্Ͱऔಘॲཧͷ࣮૷ͷมߋΛ͢Δ

    View full-size slide

  58. 59
    34$ͱ(SBQI2-
    w εΩʔϚͱͯ͠ͷརศੑ
    w (SBQI2-
    w 4DBMBSɺEJSFDUJWFͳͲ͸ศར
    w 34$3&45
    w 0QFO"1*͸͋Δ͕རศੑ͸ྼΔ
    w ࠷ۙొ৔ͨ͠5ZQF4QFD͸εΩʔϚͷγϯϓϧ͞΍རศੑ͕(SBQI2-ʹ͍ۙͷͰ஫໨
    ͍ͨ͠IUUQTUZQFTQFDJP

    View full-size slide

  59. 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ͰରԠΛਐΊ͍ͯΔ

    View full-size slide

  60. 61
    ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠
    4QFBLFS%FDLͷ֓ཁཝʹؔ࿈εϥΠυΛܝࡌ͍ͯ͠·͢

    View full-size slide