In Relay GraphQL, connections and lists are both array-like, but they have different features. When should I use each?
Relay is recommended to use in the frontend to have more structured, modular, future-proofed applications that can scale easily to millions of users. The first thing that needs to be implemented in order to use Relay is to make a Relay-compatible GraphQL server. That's what we're going to do now.
Relay is a JavaScript framework for fetching and managing GraphQL data in React applications that emphasizes maintainability, type safety and runtime performance. Relay achieves this by combining declarative data fetching and a static build step.
A connection is a way to get all of the nodes that are connected to another node in a specific way. In this case we want to get all of the nodes connected to our users that are friends. Another connection might be between a user node to all of the posts that they liked.
RANGE_ADD
, RANGE_DELETE
, NODE_DELETE
, as described in the guide).first
or last
argument in order to limit the size of the result set.edges
field that provides a place to locate per-edge, edge-specific data.first
with some large number.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With