Summary of GraphQL Europe Conference
During this weekend I had a great experience at the GraphQL Europe Conference in Berlin.
Available slides
- 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
Notes
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:
Static,compiled + optimizations,whitelisted,dynamic,persisted[1][2]. - 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
DataLoader. N+1 problem– and the solution is batching queries. There are tools for this.SubscriptionsvsLive Queriesexist with different use-cases, we’re interested inSubscriptions.- Use the
Schemas/Types. Nice optimizations can be implemented when relying on the AST for theSchemas/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.
Optimistic UIs.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?
is/has/canprefixes for boolean values- Directives, new ones like
@defer,@futureare coming. - Rate limiting/Throttling of queries.
- Use GraphiQL for explorative development.
GraphQL IDLbyGRAPHCOOL.GraphQL Voyager- Visual Representation for the Schema.GraphQL Faker- mock data.GraphQL Docs- generate docs from schemas.- Think about versioning.
- Useful tools at
awesome-graphql. - EDIT: It’s now possible to use
neo4jwithGraphQL.
The conference receives several 👍 from me.
Great work, let’s hope we get to go next year as well!