What is Relate

Relate is a library built to use together with Redux and GraphQL. You can think of it as an alternative to Relay for Redux. It extends the React Redux’s connect() function where you can additionally specify your container’s data needs. Relate will resolve each container data needs automatically and provides it to each one the data they requested.

Relate follows a similar API to Relay, it isn’t a replacement but an alternative to it with some more freedom which might be a better fit for some projects.

Why Relate?

This project was made out of necessity due to a grow of data complexity in Relax CMS. Redux is an awesome tool to handle an application data. The problem is when you get containers competing for the same resources, in Redux this can only be solved by scoping your reducers or creating more to accommodate all use cases and containers specifications. This doesn’t scale well!

Why not Relay to solve this?

Relay is a great project which might fit perfectly for some projects. For us at Relax it had a lot of constraints we couldn’t get around easily:

If you identify with these problems, Relate might be a good option. If not, Relay is your pick.

Differentiation Points

Relate tries to solve some of the problems mentioned above, which of course comes with some counterparts. What Relate solves:

It loose some capabilities over Relay that can be worked out eventually: