- What's the difference between Relay and other Flux inspired libraries like Redux?
- There is no difference, Relay is just another Flux option.
- Relay is meant for React Native apps, you should stick with Redux for web apps.
- Relay helps scale your Flux architecture by allowing data dependency declarations and hiding all of the server communication complexity.
- How does Relay simplify the data requirements of React components?
- By collocating the data dependency queries, you can see exactly what data your components use without having to sift through code that does the fetching.
- By fetching all of the application data upfront, Relay can then query locally for data that each of your components need.
- By abstracting network calls. GraphQL is optional, you can use straight HTTP if you want instead.
- How do your React components communicate with the server in a Relay based application?
- You have to implement your own network communication logic. Relay just handles getting data to components.
- Relay compiles the GraphQL queries that it finds in your components and handles all of the GraphQL server communication for you, including caching optimizations.