Developer Experience in GraphQL Schema-first Development

Developer Experience in GraphQL Schema-first Development

This slides shows how GraphQL schema-first development worked on my team.

Talked at GraphQL について語る会
https://m3-engineer.connpass.com/event/145259/

509e5167fdb3871d6b6e045e34a3e019?s=128

Takayuki Matsubara

October 09, 2019
Tweet

Transcript

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

  2. self-introduction • Takayuki Matsubara • ma2ge@twitter • ma2gedev@github • Ruby,

    Elixir, OSS, Keyboards and • PowerAssertEx ⭐# • github.com/ma2gedev/power_assert_ex
  3. self-introduction • GraphQL • ΤϜεϦʔςοΫϒοΫ#1 @ ٕज़ॻ య6(2019/04)

  4. Developer Experience in GraphQL Schema-first Development

  5. Schema-first development

  6. in GraphQL • Define schema first, next implement based on

    schema # Book type Book { # what is book ... } type Query { # returns book list books: [Book]! }
  7. Pros • Develop Client/Server concurrently • Documentation

  8. None
  9. In the real world

  10. Our team • iOS 2 • Android 2 • Server

    2(almost 1.5)
  11. 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
  12. Carrying GraphQL to the team

  13. Develop Client/Server concurrently

  14. 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
  15. 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)
  16. Documentation

  17. Before GraphQL • Sometimes forgot to update

  18. Update documentation with code after GraphQL • Ensure schema and

    code are same • Cons: comments are not required type Query { # returns book list books: [Book]! }
  19. and more...

  20. 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
  21. Summary • Schema-first development worked our team

  22. END 2019/10/09 @ma2ge

  23. 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
  24. Resources • ϑϩϯτΤϯυ޲͚ͷ API αʔόϦχϡʔΞϧʹ GraphQL Λݕ౼͍ͯ͠Δ࿩ - ΤϜεϦʔςοΫϒϩά •

    https://www.m3tech.blog/entry/graphql-on-spring-boot- with-kotlin