|
|
|
|
|
by leebyron
3349 days ago
|
|
Hi, Lee from the GraphQL/Relay team here You're not off base at all! It's very similar to that. I think it's important to extract what was good and bad about this old website pattern. The good is that within a single PHP file you could see both the logic for requesting data (SQL) AND the logic for rendering that data. This colocation was part of what made the early web take off, it was a great developer experience. The bad is that these interspersed SQL statements were immediately invoked and blocking, which led to utterly awful performance. One of the core ideas of Relay is that we wanted to bring back that developer experience of colocation while not only retaining good network performance, but actually creating opportunities for network optimization. When you see GraphQL in your Relay code, that is not a blocking immediately invoked network request. It's a description of a part of data needed. Relay aggregates these GraphQL fragments together to submit in few network requests in a non-blocking way to achieve the network performance we expect from modern mobile applications. |
|