Page MenuHomePhabricator

๐Ÿ“Œ๏ธ Build look up items by sitelink in GraphQL
Closed, ResolvedPublic8 Estimated Story Points

Description

We would like to allow looking up items i.e., responses that give a single item or nothing back (in contrast to searching) by site ID and title. Lookup by URL was split out into T421861 and is not part of this story.

Acceptance criteria:

  • The field name would be "itemBySitelink" and would take the site id and the title as input

Task Breakdown notes:

  • use existing SiteLinkLookup service
  • create a use case that performs the lookup and returns an Item ID or null
  • the lookup resolver will call the ItemResolver

**Open questions for Product:*

  • how complex is a sitelink lookup (i.e. how many lookups are allowed in a single query?)

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJan 2 2026, 9:53 AM
Ifrahkhanyaree_WMDE renamed this task from Add functionality to look up items by external id to Add functionality to look up items by external id or sitelink.Jan 2 2026, 9:53 AM

Notes:

  • Split this into two tasks about sitelinks and external ID
  • AC would include having a new query field and response to be a single item or none
  • For sitelink the field name would be "itembysitelink" and would take the site id and the title OR just the site id as input
  • For external ID the field name would be "itembyexternalD" and would take the external id and its corresponding property id as input
Ifrahkhanyaree_WMDE renamed this task from Add functionality to look up items by external id or sitelink to Build look up items by sitelink in GraphQL.Mar 10 2026, 4:20 PM
Ifrahkhanyaree_WMDE updated the task description. (Show Details)
WMDE-leszek set the point value for this task to 8.
Silvan_WMDE renamed this task from Build look up items by sitelink in GraphQL to ๐Ÿ“Œ๏ธ Build look up items by sitelink in GraphQL.Mar 18 2026, 4:31 PM
Silvan_WMDE removed Silvan_WMDE as the assignee of this task.
Silvan_WMDE moved this task from Doing to To Do on the Wikibase Reuse Team (Sprint 65) board.
Silvan_WMDE subscribed.
Jakob_WMDE subscribed.

Can be tested on https://test.wikidata.org/w/api.php?action=wbgraphql&format=json e.g. with the following query:

{
  itemBySitelink(siteId: "enwiki", title: "Test") {
    id
  }
}

Change #1266856 had a related patch set uploaded (by Jakob; author: Jakob):

[mediawiki/extensions/Wikibase@master] GQL: Fix itemBySitelink when no item is found

https://gerrit.wikimedia.org/r/1266856

Change #1266856 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] GQL: Fix itemBySitelink when no item is found

https://gerrit.wikimedia.org/r/1266856