The case for and against. What Relay does well, and when it costs too much.
For. What works in its favour.
- GraphQL framework fully optimized for React and declarative fragments.
- Compile-time pre-compilation for better performance.
- Automatic and very efficient cache with data synchronization.
- Optimistic mutations with automatic rollback on error.
- Type-safe with TypeScript and Flow type generation.
- You need sophisticated caching and data-synchronization management.
- You work in a large team where data-fetching scalability matters.
Against. What to plan for.
- Steep learning curve, complex concepts to master.
- Requires a compilation step (relay-compiler).
- Fewer educational resources than Apollo Client.
- Overkill for simple applications with few mutations.
- You're just starting with GraphQL.
- You want a lightweight and simple GraphQL solution (prefer Apollo Client).
