gbif / hp-uk-collections

Source for the DiSSCoUK Data Portal provided by GBIF Hosted Portals
https://dissco-uk.org/
2 stars 1 forks source link

Switch to GBIF predicate search API to get record count #51

Open jrdh opened 3 months ago

jrdh commented 3 months ago

This is a WIP as it currently doesn't work.

We're using the graphql API to pull counts from atm but the queryId parameter isn't stable, nor is it known to me (currently) how this is generated/assigned/used. We copied the queryId from the running search pages for occurrences and institution and every so often they change, breaking the counts on the homepage and requiring us to update the values. This isn't the biggest woop but it'd be better if we didn't have to do this.

This PR changes the specimen count to come from the GBIF occurrence search predicate API instead. The only problem is the root predicate is defined using field names that work through graphql but not through the predicate API 🙁 So currently, this doesn't work.

I opened this PR as a draft wip just so that I didn't have to do the minor refactor again if it starts to work or we find a workaround.