During this weekend I had a great experience at the GraphQL Europe Conference in Berlin.

Available slides

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.
  • Subscriptions vs Live Queries exist with different use-cases, we’re interested in Subscriptions.
  • Use the Schemas/Types. Nice optimizations can be implemented when relying on the AST for the Schemas/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/can prefixes for boolean values
  • Directives, new ones like @defer, @future are coming.
  • Rate limiting/Throttling of queries.
  • Use GraphiQL for explorative development.
  • GraphQL IDL by GRAPHCOOL.
  • 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 neo4j with GraphQL.

The conference receives several 👍 from me.

Great work, let’s hope we get to go next year as well!