GraphQL-powered Wikidata item advanced search.
https://wdquery.toolforge.org/
Developer Blog
- v26.3.10 : I’m really excited to test this GraphQL API, so I built this one to try it out. So far, so good. I’m really impressed that the data updates are nearly instant (Whenever I change a Wikidata item label, it changes instantly in the GraphQL API. In contrast, when I use the SPARQL-based API endpoint, I notice some delays). My question is: can we increase the limit from 50 items? The GraphQL endpoint still can’t completely replace the SPARQL-based endpoint if it is limited to only 50.
- v26.3.12 : "Just to be sure, you can get more than 50 items, just not all at once. We have pagination built into the API"
- I tried to query ‘instance of human’ (P31–Q5) in GraphQL using pagination, but since the hasNextPage result is empty, I can’t paginate further.
- Update: If I just ignore the emptiness of hasNextPage and simply ask for more items using the endCursor, it works fine. The problem is that it doesn’t know when to stop. If the user keeps asking for more items using this trick, it will eventually loop back to the first items that were already queried before and never end.
- Update: endCursor will return null once it reaches the last page. So we can use that to signal that pagination has reached the final page. Even if hasNextPage doesn’t work, we can use endCursor as a workaround.