
Relay
91 posts

Relay
@RelayFramework
Relay is a framework for managing GraphQL data in React applications










✅ @graphql Fragments used unconditionally and fetched unconditionally: 30 🙁 Fragments that maybe don't need to be fetched, if we had 3D: 6 😒 Fragments fetched unconditionally, but used conditionally (behind a prop, other field's nullability, or experiment): 28!! 😲 Fragments used only in an event or callback: 11 😭 Fragments that are only used by UI that isn't initially rendered, thus are good candidates for entrypoints: 6 That's... 37% of fragments that are always needed for the initial render. In practice, many of the 28 that are fetched unconditionally, but used conditionally, will be needed for any given render. So, I'm being a bit pessimistic here. But nonetheless, quite instructive!

The fragments that are used only in an event make me think that @RelayFramework has a missing primitive: the ability to defer a fragment and read it, without suspending, but instead to get a promise that resolves with the deferred fragment's value.








