DEV Community

Bogdan Nedelcu
Bogdan Nedelcu

Posted on

GraphQL at global scale: Facebook

From the news:

A few weeks ago Facebook rolled out its new desktop design.

One of the many improvements they are experimenting with is lazy loading where they prefetch both the code and the data needed by a view.

What draw my attention is the introduction of entry points:

"files that wrap a code-split point and transform inputs into queries.
These files are very small and are downloaded in advance for any
reachable code-split point."

The so-called entry points unify the fetching of code and data a view needs in one single GraphQL query:

"This has the added benefit of creating a single JavaScript function
that contains all the data-fetching needs for any given point in the
app, which can be used for the server preloading discussed earlier."

The new approach leverages GraphQL's ability to unity request and minimizes network usage in a way I have never seen before.

This literally blew my mind. 🚀

I cannot wait for further releases of their performance improvements and will try to use this in my future projects.

What do you think?

Have you ever seen code and data fetching done simultaneously?

More on Facebook's engineering blog here.

Top comments (0)