Page MenuHomePhabricator

Create a GraphQL MediaWiki extension and delegate schema & queries to the relevant sites
Open, Needs TriagePublic

Description

Problem
There is a lot of domain knowledge that is contained in core or in extesions. For instance, should the Wikimedia GraphQL server have a type for every type of Page in MediaWiki? Should it have a type for every type of image? Should it maintain different types for each type of Entity in Wikibase? What about the types on Commons? Also, arguments typically have enums for acceptable values, should the server maintain it's own list? In the current implementation, this domain knowledge would have to be copied into the Wikimedia GraphQL server's code and would have to be maintained, which is a huge burden.

The Wikimedia GraphQL server makes requests to MediaWiki using the Action API. This is time consuming and requires multiple HTTP round trips and hinders the performance of GraphQL.

Solution
Create a GraphQL extension for MediaWiki that will expose a GraphQL endpoint and execute Action API methods in PHP. The GraphQL Schema will stay relatively the same as it is today.

The Wikimedia GraphQL server will then use Schema Stitching to delegate execution to the relevant site.

The extension should provide all of the schema for the core API actions, and provide hooks for other extensions to be able to add/modify the schema. For instance, Wikibase would provide the typing(s) for WikibaseEntity. Likewise, Structured Discussions will provide the types for Flow.

The Wikimedia GraphQL server should override some of the schema that comes from Wikidata and do the delegation for it. For example, Wikidata might return a sitelink with a dbkey and the Wikimedia GraphQL server should transform this to a link to the page schema on the relevant wiki (as it does now). This way Wikidata (or any MediaWiki site) only serves its own data (that is normally retrievable with the Action API)

Event Timeline

dbarratt renamed this task from Create GraphQL MediaWiki extension and delegate queries to the relevant sites. to Create GraphQL MediaWiki extension and delegate queries to the relevant sites to increase performence.Nov 9 2018, 3:07 AM
dbarratt created this task.
dbarratt updated the task description. (Show Details)
dbarratt renamed this task from Create GraphQL MediaWiki extension and delegate queries to the relevant sites to increase performence to Create a GraphQL MediaWiki extension and delegate queries to the relevant sites to increase performence.Nov 9 2018, 3:11 AM
dbarratt moved this task from Backlog to To Do on the GraphQL board.Nov 13 2018, 11:42 PM
dbarratt renamed this task from Create a GraphQL MediaWiki extension and delegate queries to the relevant sites to increase performence to Create a GraphQL MediaWiki extension and delegate queries to the relevant sites.Nov 13 2018, 11:52 PM
dbarratt updated the task description. (Show Details)
dbarratt updated the task description. (Show Details)
dbarratt renamed this task from Create a GraphQL MediaWiki extension and delegate queries to the relevant sites to Create a GraphQL MediaWiki extension and delegate schema & queries to the relevant sites.Nov 14 2018, 12:41 AM

Change 474477 had a related patch set uploaded (by Dbarratt; owner: Dbarratt):
[mediawiki/extensions/GraphQL@master] Create the GraphQL extension.

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

Change 474477 merged by Dbarratt:
[mediawiki/extensions/GraphQL@master] Create the GraphQL extension.

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

dbarratt moved this task from To Do to In Progress on the GraphQL board.Feb 9 2019, 3:08 AM