https://github.com/artsy/javascriptures/tree/master/4_intro-to-relay
RelayLet there be data in the firmamentJavaScriptures IV.IAlloy
View Slide
Why have an API client at all?
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 placeResponsibilities of an API client
RelayA framework for data-driven React apps
Declare the data your components need with GraphQL, Relay determines how andwhen to fetch your data.Declarative
GraphQL is written next to the views that rely on them. Relay aggregates queries intoefficient network requests.Colocation
Write GraphQL mutations and Relay offers automatic data consistency, optimisticupdates, and error handling.Mutations
Relay compiler uses your full GraphQL schema at compile-time to ensure the dataconsistencySafety
Example
Competitors