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

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 について語る会

Takayuki Matsubara

October 09, 2019

More Decks by Takayuki Matsubara

Other Decks in Programming


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

    Elixir, OSS, Keyboards and • PowerAssertEx ⭐# • github.com/ma2gedev/power_assert_ex
  2. in GraphQL • Define schema first, next implement based on

    schema # Book type Book { # what is book ... } type Query { # returns book list books: [Book]! }
  3. 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
  4. 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
  5. 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)
  6. Update documentation with code after GraphQL • Ensure schema and

    code are same • Cons: comments are not required type Query { # returns book list books: [Book]! }
  7. 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
  8. 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