As a follow-up to the work done in https://phabricator.wikimedia.org/T396983, we'd like to build a prototype for the labels of linked entities functionality in GraphQL on a publicly available wiki like beta or patch demo
Acceptance criteria:
- For the endpoint itself, we'll limit it to a GET item/label and a GET item/statement
- Ensure that only the labels of linked entities (statement property and statement value items) can be requested, and not everything else (for example, descriptions or subsequent statements and so on.)
- statement value types that must be supported: string values and item values
- The final endpoint will be exposed through a special page
- if possible, check if we can make it easy to try out via GraphiQL client on another special page
Task breakdown
- create a special page that exposes a GraphQL endpoint
- should allow for querying a single item and return its ID
- example query: { item(id: "Q71") { id } }
- fetching labels of the item
- { item(id: "Q71") { labels { ar de en } } }
- fetching statements of the item including statement property ids and labels
- example query:
{
item(id: "Q71") {
statements {
property {
id
labels { en }
}
}
}
}- Batching to ensure that statement property labels are queried at once (possibly together with the labels of the main item)
- Support querying statements with string values
- filter out statements with value types we don't support
- "type" for the value type might be a reserved keyword
- example query:
{
item(id: "Q71") {
statements {
property {
id
}
value {
type
content
}
}
}
}- Support item values
- Support labels of item values
- GraphiQL