Anyone here had experience using facebook relay in...
# orm-help
n
Anyone here had experience using facebook relay instead of apollo. In the past I have only worked with apollo. I just recently picked up gatsby.js the data fetching is so fast basically it runs graphql in build time. Its crazy fast literally no loading state at all, that was always something that bothered me using apollo. It took so long for the data to appear on screen whereas with gatsby.js the view-layer and the data-layer is one-to-one kinda reminds me of the old mvc pattern. Important if going to build any data driven application. I wonder if graphql-relay can offer same speed and performance?
h
Gatsby.js is a static site generator. It is not suitable for all of the cases like if you want to build something like airbnb which needs dynamic content from the server. Gatsby is perfect for small blogs and thing that doesn't often change much.
Apollo and relay on the other hand are actual graphql client. They make request to server to fetch the data. That is why they are slower than gatsby as they need to hit the server but they fetch the fresh data everytime
Main different between apollo and relay is ease of use and scalability. Apollo is very easy to use as compared to relay. Relay was made to solve issues at the scale of facebook and it is very opinionated by certain things like pagination. Apollo in the other hand is fully community based. I will recommend you to use apollo over relay as apollo has a very robust community and is actively maintained. Relay on the other hand is more suitable for large enterprise thing. It gives structure just like redux. But it has a very steep learning curve and it is not worth it in my opinion. Even airbnb is using apollo now: https://medium.com/airbnb-engineering/how-airbnb-is-moving-10x-faster-at-scale-with-graphql-and-apollo-aa4ec92d69e2
I recommend you should not compare apollo or relay with gatsby as they solves different problems.
Rule of thumb: Apollo or relay for dynamic applications and gatsby for static sites