During this weekend I had a great experience at the GraphQL Europe Conference in Berlin.
- Adding GraphQL to your existing architecture by Sashko Stubailo
- Building global GraphQL API distribution by Jakub Riedl
- Fighting legacy codebases with GraphQL and Rails by Netto Farah
- GraphQL - Evolution or Revolution? by Jonas Helfer
- Launching GitHub’s Public GraphQL API by Brooks Swinnerton
- MockQ buddy! Easy API Driven Design and Accurate Documentation with GraphQL by Alison Johnston
- Using GraphQL in a Mesh Network to Enable Real-Time Collaboration by Tommy Lillehagen
Below is a brief summary of the common decisions, lessons learnt, solutions and thoughts from the speakers at the conference, about how to use GraphQL in production at scale:
- To use GraphQL in a near real-time fashion, the language will need an extension that sends query + subscription at the same time.
- There are different types of queries with trade-offs:
compiled + optimizations,
- You will want to apply instrumentation of queries and only optimize those that data shows are slow.
- Cache queries & results, e.g. HTTP cache headers & client/server-side caching via
N+1 problem– and the solution is batching queries. There are tools for this.
Live Queriesexist with different use-cases, we’re interested in
- Use the
Types. Nice optimizations can be implemented when relying on the AST for the
Types. E.g. Don’t have any mutations in a query? Then redirect the underlying query to use the read-only replica DB, otherwise hit the write/read one.
Client-driven development– the client (or the User of the thing) sets the constraints and interfaces
- Use Fragments as a first primitive. Look at col(l)ocation.
Apollo Optics: Store data about the query, like SQL statements that were generated.
- Ruby gem to annotate definitions with accepted_scopes // authorization layer on top of resolution.
- Public/Private separation of schemas for dev/production separation.
- Pagination via first/last parameters - perhaps add offset?
canprefixes for boolean values
- Directives, new ones like
- Rate limiting/Throttling of queries.
- Use GraphiQL for explorative development.
GraphQL Voyager- Visual Representation for the Schema.
GraphQL Faker- mock data.
GraphQL Docs- generate docs from schemas.
- Think about versioning.
- Useful tools at
- EDIT: It’s now possible to use
The conference receives several 👍 from me.
Great work, let’s hope we get to go next year as well!