$30 off During Our Annual Pro Sale. View Details »

Evolving the Graph

jnwng
June 21, 2019

Evolving the Graph

Coursera has had GraphQL in production for over three years now — here's the story of how we started, what things have stood the test of time, and what things haven't.

jnwng

June 21, 2019
Tweet

More Decks by jnwng

Other Decks in Technology

Transcript

  1. Evolving the Graph GraphQL Conf 2019

  2. jon wong @jnwng developer experience

  3. None
  4. we envision a world where anyone, anywhere can transform their

    life by accessing the world’s best learning experience.
  5. (p.s., we're hiring in mountain view and toronto)

  6. Evolving the Graph GraphQL Conf 2019

  7. None
  8. Evolving Our Graph GraphQL Conf 2019

  9. DISCLAIMER Take everything beyond with a large Coursera- sized grain

    of salt. What works for our team may not work for yours.
  10. Coursera has been using GraphQL for over three years!

  11. GraphQL Three Years Ago We wanted a "data-first" solution to

    reflect our REST APIs in GraphQL
  12. GraphQL Three Years Ago Clients were responsible for calling for

    the correct data for themselves.
  13. The Tools (three years ago)

  14. Federation

  15. Code-first Schema Generation

  16. Schema Stitching

  17. Lessons Learned (three years later)

  18. Federation

  19. Federation meant teams could retain ownership over their services.

  20. Federation with REST meant we only had one GraphQL resolver

  21. Federation with REST meant you previewed changes in production.

  22. Code-first Schema Generation

  23. Code Generation It was really simple to get existing REST

    resources into our schema.
  24. Code Generation It was really simple to get existing REST

    resources into our schema.
  25. Code Generation ~ 7,546 types ~ 664 root fields

  26. Schema Stitching

  27. Schema Stitching Namespacing our types gave our graph room to

    grow. We have ~600+ distinct REST resources.
  28. Schema Stitching We never had to figure out how to

    "deprecate" a field
  29. Some things surprised us.

  30. GraphQL clients are incredibly powerful For every feature our servers

    didn't have, our clients could add support.
  31. Our implementation of GraphQL didn't look like GraphQL in the

    wild.
  32. Our Biggest Realization

  33. Is a data-first schema the best use of GraphQL?

  34. The schema of your service is not always the same

    as the schema you want for your client.
  35. None
  36. None
  37. Clients don't just need data, they need information.

  38. Where We Go From Here

  39. Optimizing for quality of schema over quantity of schema.

  40. Coordination between engineers happens with GraphQL schemas as our common

    language.
  41. We're vastly more intentional about what goes into the schema.

  42. The graph doesn't evolve, people do.

  43. Thanks! @jnwng