Something went wrong while fetching comments. Please try again.
Created by: philipp-spiess
Fixes #32414 (closed)
The homepage is currently loading data for all its panels in parallel resulting in multiple simultaneous GraphQL queries and an awkward loading situation where data is displayed as soon as it comes in. This approach doesn't scale and would lead to us making multiple concurrent requests on the homepage loads in the future. This PR is an attempt to clean this up while keeping the following properties:
The biggest change here comes from the fact that I have removed the different data fetching calls in favor of one Relay query in the parent component. The query combines fragments from the children it renders and defines a sensible set of default element. This query needs to know which fragment it renders, however we can use Apollo directives to avoid forking the query and have the logic relatively concise.
Inside the individual panels, we make use of the fetchMore
filter to load more results. This will cause the query to be re-run with a new set of arguments but does not update it's data. We can then keep a separate copy in the component's state that appends the new results while every other panel is kept as-is.