Slide 1

Slide 1 text

GraphQL RubyͰ εΩʔϚۦಈ։ൃΛମײͨ͠࿩ 2022/10/09 Kaigi on Rails _2022_ new 
 Amane Inoue (@isaka1022), mybest, Inc.

Slide 2

Slide 2 text

Amane Inoue @isaka1022 גࣜձࣾϚΠϕετ΁21ଔೖࣾ όοΫΤϯυΤϯδχΞ ॳΊͯ৮ͬͨWEBΞϓϦέʔγϣϯϑϨʔϜɿ 
 Ruby on Rails ະख़ऀͰ͕͢ԿଔΑΖ͓͘͠ئ͍͠·͢ʂ

Slide 3

Slide 3 text

͓͢͢Ί৘ใݕࡧαʔϏεʮmybestʯ

Slide 4

Slide 4 text

ΞʔΩςΫνϟҠߦΛਐߦத ੩తͳslimϑΝΠϧ + VueʹΑΔಈతͳϨϯμϦϯά Next.jsʹΑΔSSR + GraphQLʹΑΔసૹ + RailsʹΑΔσʔλॲཧ

Slide 5

Slide 5 text

• ͜Ε·ͰAPIΛ࣮૷͔ͯ͠ΒϑϩϯτΤϯυͷ࣮૷ʹότϯλον εΩʔϚۦಈ։ൃΛମײͰ͖ͨ GraphQL Λ׆༻ͨ͠εΩʔϚۦಈ։ൃͷ࣮ફ( qsona ) https://speakerdeck.com/qsona/schema-driven-development-with-graphql

Slide 6

Slide 6 text

• GraphQLεΩʔϚΛఆٛͯ͠ฒߦͯ͠։ൃ εΩʔϚۦಈ։ൃΛମײͰ͖ͨ GraphQL Λ׆༻ͨ͠εΩʔϚۦಈ։ൃͷ࣮ફ( qsona ) https://speakerdeck.com/qsona/schema-driven-development-with-graphql

Slide 7

Slide 7 text

࣮ࡍʹࠓظ΍ͬͨखॱ

Slide 8

Slide 8 text

Resolverͱܕɺٴͼඞཁͳ fi eldΛ༻ҙ • ϚΠϕετͰ͸code- fi rstΞϓϩʔνΛ࠾༻ • RubyͷίʔυΛݩʹεΩʔϚΛఆٛ͢Δ • ຊདྷతʹ͸͜ϑϩϯτΤϯυΤϯδχΞͱҰॹʹεΩʔϚઃܭ͢Δ • ࠓճ͸طଘͷ࢓༷ʹैͬͯόοΫΤϯυଆͰԾ࣮૷

Slide 9

Slide 9 text

μϛʔσʔλΛฦ͢Α͏ʹ͢Δ • ϩδοΫ͸࣮૷͠ͳ͍ • ฦ͢ܕ͚ͩ߹ΘͤͨμϛʔσʔλΛฦ͢Α͏ʹ͢Δ

Slide 10

Slide 10 text

ϑϩϯτΤϯυଆ͔ΒͷϨϏϡʔ • ͜ͷ࣌఺ͰϑϩϯτΤϯυଆ͔ΒͷϨϏϡʔΛ΋Β͏ • OKͦ͏Ͱ͋Ε͹͜ͷ··APIϦϦʔεʢ৽ن௥ՃͷΤϯυϙΠϯτʣ

Slide 11

Slide 11 text

όοΫΤϯυͱϑϩϯτΤϯυΛฒߦ࣮ͯ͠૷ • όοΫΤϯυͱϑϩϯτΤϯυΛฒߦ࣮ͯ͠૷ • ϑϩϯτΤϯυˠը໘ • όοΫΤϯυˠϩδοΫͷৄࡉ • ΤϯυϙΠϯτͷϞοΫΛ͢΂ཱ͔ͯͯͯΒϩδοΫͷৄࡉΛ࣮૷͍ͯ͘͠

Slide 12

Slide 12 text

ϑϩϯτΤϯυͷ࣮૷தʹϑΟʔϧυʹ มߋ͕ඞཁͳ৔߹ • ϑϩϯτΤϯυͷ࣮૷ʹԠͯ͡ϑΟʔϧυͷఆٛʹมߋ͕ඞཁͳ৔߹ • దٓ૬ஊ • ·ͨ͸ϑϩϯτΤϯυଆʹ߹Θͤͯमਖ਼ˠόοΫΤϯυͰίʔυϨϏϡʔ

Slide 13

Slide 13 text

΍ͬͯΈͨײ૝ • ʮ࣮૷଴ͪʯ͕࣌ؒѹ౗తʹݮͬͨ • ૣ͍ஈ֊ͰϑϩϯτΤϯυΤϯδχΞʹλεΫΛ౉ͤΔͷͰɺϓϨο γϟʔ͕গͳ͍ • εΩʔϚΛϕʔε(ڞ௨ݴޠ)ʹϑϩϯτΤϯυΤϯδχΞͱ࢓༷ʹͭ ͍ͯίϛϡχέʔγϣϯ͕औΕΔ

Slide 14

Slide 14 text

΍ͬͯΈͯͷ՝୊ײɾ൓ল • εΩʔϚͷઃܭΛόοΫΤϯυ͕த৺ʹͳͬͯߦͬͨ݁Ռɺϑϩϯτ Τϯυͷ࣮૷ͷࡍʹઃܭमਖ਼͕૸ͬͨ • ৮Δਓ͕ϑϩϯτɾόοΫ྆ํͷ஌͕ࣝଟগඞཁ • όοΫΤϯυΤϯδχΞ͕ϑϩϯτΤϯυͷ࣮૷Πϝʔδ͕ͣ͠Β ͍ͱεΩʔϚͷઃܭ೉͍͠ • ϑϩϯτΤϯυΤϯδχΞ͕ fi eldͷमਖ਼Λ͍ͨ͠ͱ͖ʹRubyͷίʔ υΛ৮Βͳ͍ͱ͍͚ͳ͍

Slide 15

Slide 15 text

ऴΘΓʹ • ·ͩ·ͩख୳ΓதɺࢼߦࡨޡதͳͷͰ࠙਌ձ౳Ͱͥͻ৭ʑ͓࿩Λฉ͔ ͍͚ͤͯͨͩΔͱخ͍͠Ͱ͢ʂ • ZennͰ΋ൃ৴தͰ͢ʂ • https://zenn.dev/mybest