QZ-509 QZ-482 Specific queries to get first N latest and popular articles #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes/resolves:
This PR adds two new queries to get first N latest and popular articles with
@connection(key: "<key>")
directive set which tells the Apollo client in consuming apps to use<key>
as part of the cache keys. This prevents the result of these two queries to overwrites or being overwritten by other unrelated queries.FirstFeedConcentByRecency
This query follows the response structure of LatestFeedContent and has any pagination-related parameters (
after
,perPage
) removed.FirstPopularArticles
This query follows the response structure of PopularArticles and has any pagination-related parameters (
after
,perPage
) removed.Notes:
@connection
directive: https://www.apollographql.com/docs/react/pagination/key-args/#the-connection-directive@connection
directive being ignored when used in conjunction with thekeyArgs
config, which is fixed in apollo client v3.5. For the FirstPopularArticles to work, we also need to update apollo client in Quartz/qz-react to that version.