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

(今更)Amplifyさっくり体験

papix
July 06, 2021

 (今更)Amplifyさっくり体験

papix

July 06, 2021
Tweet

More Decks by papix

Other Decks in Technology

Transcript

  1. ࣗݾ঺հ • papix (id:papix / @__papix__) • גࣜձࣾ͸ͯͳ WebΞϓϦέʔγϣϯΤϯδχΞ (2017೥ʙ)

    • ϒϩάMediaνʔϜ → ϚϯΨνʔϜ • Ұൠࣾஂ๏ਓJapan Perl Associationཧࣄ • ϒϩά: https://papix.hatena(blog.(com|jp)|diary.jp)
  2. AWS AmplifyͰྑ͔ͬͨ͜ͱ • CLIͰαΫοͱϦιʔε͕ੜ͑Δ • ňamplify auth addʼnͰCognito͕ੜ͑Δ • ňamplify

    storage addʼnͰS3͕ੜ͑Δ • ňamplify api addʼnͰGraphQL endpoint (AppSync)͕ੜ͑Δ
  3. AWS AmplifyͰGraphQLͷSubscription // Activityͷ௥ՃΛsubscribe͢Δ const createActivitySubscription
 = API.graphql(graphqlOperation(onCreateActivity)) as Observable<Record<string,

    unknown>> ; createActivitySubscription.subscribe( { next: e => { const createdActivity = e.value.data.onCreateActivity ; // createdActivity͕, ௥Ճ͞ΕͨActivit y // Α͠ͳʹॲཧΛ͢Δ } });
  4. AWS AmplifyͰ೉͔ͬͨ͜͠ͱ • ͪΐͬͱڽͬͨ͜ͱΛ͠Α͏ͱ͢Δͱେม(ͳ͜ͱ͕͋Δ) • ࣾ಺ͷ։ൃ߹॓Ͱར༻͢Δ΋ͷͩͬͨͷͰ, CognitoͰϝʔϧΞυϨ εͷυϝΠϯͰ੍ݶΛ͔͚Α͏ͱͨ͠ • Կނ͔͏·͘ߦ͔ͣ,

    ࢼߦࡨޡͷ຤ϩάΠϯ͕Ͱ͖ͳ͘ͳͬͨ... • ࠷ऴతʹ, 3೔ؒͰ4ճΠν͔ΒAmplifyͰ؀ڥΛ࡞Δ͜ͱʹͳͬͨ • ௨শňAmplify؀ڥߏஙRTAʼn
  5. AWS Amplify ײ૝ • ϓϩτλΠϐϯάʹ͸ຊ౰ʹ࠷ద • "ຊ࣭"ʹूத͢Δ͜ͱ͕Ͱ͖ͨ • ࣮ࡍʹαʔϏεͱͯ͠ఏڙ͢Δࡍʹ࢖͏͔͸ཁݕূ •

    บ͕͋Δ఺͕ଟ͍ • ň΋͠Ұൠʹఏڙ͢ΔͳΒGo(GraphQL) + Next.jsͰ࡞Γ௚͔͢ ͳ...ʼnͱ͍͏ձ࿩Λͨ͠