Extension:GraphQL
![]() Release status: experimentalCategory:Experimental extensions |
|
---|---|
![]() |
|
Implementation | APICategory:API extensions |
Description | GraphQL proxy for the Action API |
Author(s) | David Barratt (DBarratt (WMF)talk) |
MediaWiki | >= 1.40 |
PHP | < 8.0 |
License | GNU General Public License 3.0 or later |
Download | Category:Extensions in Wikimedia version control |
|
|
Quarterly downloads | 3 (Ranked 113rd) |
Translate the GraphQL extension if it is available at translatewiki.net | |
Issues | Open tasks · Report a bug |
GraphQL extension exposes a /graphql
endpoint in MediaWiki as a proxy for the Action API and REST API.
Installation
- Download and move the extracted
GraphQL
folder to yourextensions/
directory.
Developers and code contributors should install the extension from Git instead, using:cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/GraphQL - Only when installing from Git, run Composer to install PHP dependencies, by issuing
composer install --no-dev
in the extension directory. (See T173141 for potential complications.)Category:Extensions requiring Composer with git - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'GraphQL' );
- Install npm dependencies with
npm install
in the extension directory Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Usage
- The GraphQL endpoint is exposed at
Special:GraphQL
with an alias at/graphql
. - The GraphQL Sandbox can be accessed at
Special:GraphQLSandbox
. The sandbox uses the GraphiQL in-browser GraphQL IDE. - The federation service endpoint is exposed at
Special:GraphQL/Federation
with an alias at/graphql/federation
.
Project Goals
- A proxy for the Action API and REST API. This extension should not expose functionality that is not already available in the existing APIs. This extension will therefore exist as a convenience to developers making bulk or recursive requests to the existing APIs.
- A federated service. This extension should be compatible with Apollo's Federation Specification or other federated specifications to allow a centralized gateway like Tool:GraphQL to make distributed GraphQL queries.
Category:API extensions
Category:All extensions
Category:Experimental extensions
Category:Extensions in Wikimedia version control
Category:Extensions requiring Composer with git
Category:Extensions without a compatibility policy
Category:GPL licensed extensions
Category:WebRequestPathInfoRouter extensions