Skip to content

Conversation

@jacbn
Copy link
Contributor

@jacbn jacbn commented Nov 7, 2025

Moves question search logic (QF, Sci subject landing page random question, gameboard builder) to RTKQ. Much of the complicated QF logic regarding pagination and checking for additional results can be achieved entirely within RTKQ, so I have moved this all over. As such, the query is perhaps more involved than others but there is now much better separation between the question search logic and the page display logic on the QF.

The other two use cases of question search will also have to use this flow now, but this is inconsequential for the random question (since the filters it uses are so broad, returning 1 extra result will never take excessive time), and makes no difference to the builder which already requests all available results. This does, however, more easily permit pagination should we wish to make the builder faster to use.

This also makes some minor modifications to ShowLoadingQuery, notably making use of a query's isUnitialized prop, which prevents the old logic from displaying an error when before the query has started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants