I host a large dataset on MongoDB (a 9MB JSON dataset with 266,000 lines and 20,000+ data rows) and I pull this data to my website via GraphQL. I built the search engine of my /rankings page using 'gatsby-plugin-local-search' and 'react-use-flexsearch', and it works fine except that it takes several seconds to load the page.
Looking for a fix on the performance issue. The loading time of the page is very high (see here https://forkked.vercel.app/rankings), so I need a fix on the GraphQL query (the files are gatsby-config.js + src/components/search.js + src/components/inputField.js + src/pages/rankings.js) so it is only triggered once a search has been performed, and not from the very first moment someone opens the website.