With more and more microservices, chances increase dramatically that you're fetching too many data from endpoints, just to discard them partially for your view layer. Because your view-layer needs only some, few properties to render something on screen/media.
With Relay, you define what data your view demands.
Relay looks like a super opinionated Redux-On-Steroids version. I hope Relay will change quite a bit soon.
The GraphQL server uses your Relay definition and starts to fetch data from API's when your client requests them. It will then send the response back to the requesting client. The client gets only the possible minimal data needed to satisfy your view needs.
Instead of programming complex HTTP requests on the client side, you put this code in a GraphQL server. A bit more separation of concerns. It will hopefully do the same what JSX already did.
I like this concept very much. Falcor.js is very similar function wise, but it uses a different programming mind model which I don't get into my brain. :-/
Denny Trebbin
Lead Fullstack Developer. Experimenting with bleeding-edge tech. Irregularly DJ. Hobby drone pilot. Amateur photographer.
I think, it will be the future.
With more and more microservices, chances increase dramatically that you're fetching too many data from endpoints, just to discard them partially for your view layer. Because your view-layer needs only some, few properties to render something on screen/media.
With Relay, you define what data your view demands. Relay looks like a super opinionated Redux-On-Steroids version. I hope Relay will change quite a bit soon.
The GraphQL server uses your Relay definition and starts to fetch data from API's when your client requests them. It will then send the response back to the requesting client. The client gets only the possible minimal data needed to satisfy your view needs.
Instead of programming complex HTTP requests on the client side, you put this code in a GraphQL server. A bit more separation of concerns. It will hopefully do the same what JSX already did.
I like this concept very much. Falcor.js is very similar function wise, but it uses a different programming mind model which I don't get into my brain. :-/