Extension:GraphQL

From mediawiki.org
MediaWiki extensions manual
GraphQL
Release status: experimental
Implementation API
Description GraphQL proxy for the Action API
Author(s) (DBarratt (WMF)talk)
MediaWiki >= 1.35
License GNU General Public License 3.0 or later
Download
  • $wgGraphQLValidateSchema
Quarterly downloads 5 (Ranked 164th)
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[edit]

  • Download and place the file(s) in a directory called GraphQL in your extensions/ folder.
  • Only when installing from Git, run Composer to install PHP dependencies, by issuing composer install --no-dev in the extension directory. (See task T173141 for potential complications.)
  • Add the following code at the bottom of your LocalSettings.php :
    wfLoadExtension( 'GraphQL' );
    
  • Install npm dependencies with npm install in the extension directory
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Usage[edit]

  • 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[edit]

  1. 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.
  2. 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.