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]!
}
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