Upgrade to Pro — share decks privately, control downloads, hide ads and more …

JavaScriptures 4.1 - Relay

JavaScriptures 4.1 - Relay

Fec952eb14022f55b2747510ac685591?s=128

Artsy Open Source

April 11, 2018
Tweet

Transcript

  1. Relay Let there be data in the firmament JavaScriptures IV.I

    Alloy
  2. Why have an API client at all?

  3. Description • Provide application code with an interface abstracted away

    from network/API details • Handle authentication in a single place • Handle caching in a single place • Handle errors in a single place Responsibilities of an API client
  4. Relay A framework for data-driven React apps

  5. Declare the data your components need with GraphQL, Relay determines

    how and when to fetch your data. Declarative
  6. GraphQL is written next to the views that rely on

    them. Relay aggregates queries into efficient network requests. Colocation
  7. Write GraphQL mutations and Relay offers automatic data consistency, optimistic

    updates, and error handling. Mutations
  8. Relay compiler uses your full GraphQL schema at compile-time to

    ensure the data consistency Safety
  9. Example

  10. Competitors