Relay (GraphQL)
https://relay.dev/docs/guided-tour/rendering/fragments/
How does Relay know which endpoint to talk to?
The useLazyLoadQuery
 hook fetches and returns the data. It takes two arguments:
- The GraphQL query that we defined before.
- Variables that are passed to the server with the query. This query doesn’t declare any variables, so it’s an empty object.
Fragments
The main building block for declaring data dependencies for React Components in Relay are GraphQL Fragments.
Fragments are a selection of fields on a GraphQL type:
fragment UserFragment on User {
name
age
profile_picture(scale: 2) {
uri
}
}
In order to render the data for a fragment, you can use the useFragment Hook: