Slide 1

Slide 1 text

Developer Experience in GraphQL Schema-first Development 2019/10/09 @ma2ge

Slide 2

Slide 2 text

self-introduction • Takayuki Matsubara • ma2ge@twitter • ma2gedev@github • Ruby, Elixir, OSS, Keyboards and • PowerAssertEx ⭐# • github.com/ma2gedev/power_assert_ex

Slide 3

Slide 3 text

self-introduction • GraphQL • ΤϜεϦʔςοΫϒοΫ#1 @ ٕज़ॻ య6(2019/04)

Slide 4

Slide 4 text

Developer Experience in GraphQL Schema-first Development

Slide 5

Slide 5 text

Schema-first development

Slide 6

Slide 6 text

in GraphQL • Define schema first, next implement based on schema # Book type Book { # what is book ... } type Query { # returns book list books: [Book]! }

Slide 7

Slide 7 text

Pros • Develop Client/Server concurrently • Documentation

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

In the real world

Slide 10

Slide 10 text

Our team • iOS 2 • Android 2 • Server 2(almost 1.5)

Slide 11

Slide 11 text

Until then • Gateway provides REST API - built in 2010 before Swagger1 • API documentation outside of code • Develop with mocking REST API or implement server first 1 https://github.com/swagger-api/swagger-core

Slide 12

Slide 12 text

Carrying GraphQL to the team

Slide 13

Slide 13 text

Develop Client/Server concurrently

Slide 14

Slide 14 text

Struggled at the beginning • Schema was defined but... • Client made client-specific mock(not apollo) because of server's mock returned less patterns of data • Insufficient disucussion about schema

Slide 15

Slide 15 text

Improved for each Scrum's iteration • Schema and mock was defined before each development • Defined schema first helped to our team's resource balance(I think it leads more flexibility about team members role)

Slide 16

Slide 16 text

Documentation

Slide 17

Slide 17 text

Before GraphQL • Sometimes forgot to update

Slide 18

Slide 18 text

Update documentation with code after GraphQL • Ensure schema and code are same • Cons: comments are not required type Query { # returns book list books: [Book]! }

Slide 19

Slide 19 text

and more...

Slide 20

Slide 20 text

Easy to disucuss about schema and query • from client and server perspectives • at review time on GitLab • chatting based on query • SDL(Schema Definition Language) formatted documentation

Slide 21

Slide 21 text

Summary • Schema-first development worked our team

Slide 22

Slide 22 text

END 2019/10/09 @ma2ge

Slide 23

Slide 23 text

Resources • 1. Build a schema - Apollo Basics - Apollo GraphQL Docs • https://www.apollographql.com/docs/tutorial/schema/ • GraphQL APIΛεΩʔϚϑΝʔετ։ൃ͢ΔͨΊͷϞοΫ αʔόΛRailsͱApolloͰ࡞Δ • https://blog.kymmt.com/entry/mocking-graphql-server- with-rails-and-apollo

Slide 24

Slide 24 text

Resources • ϑϩϯτΤϯυ޲͚ͷ API αʔόϦχϡʔΞϧʹ GraphQL Λݕ౼͍ͯ͠Δ࿩ - ΤϜεϦʔςοΫϒϩά • https://www.m3tech.blog/entry/graphql-on-spring-boot- with-kotlin