Page MenuHomePhabricator

Create a rewrite for the GraphQL endpoint on wikidata.org
Closed, InvalidPublic

Description

We will initially create the GraphQL API as an Action API module, but we don't think this is where it should live indefinitely. In order to avoid breaking the URL and having to update all documentation, we would like to have a URL rewrite to keep the URL stable.

The URL should be https://www.wikidata.org/graphql.

This task probably starts with a rewrite rule in apache config, possibly in https://gerrit.wikimedia.org/r/plugins/gitiles/operations/puppet/+/production/modules/mediawiki/files/apache/sites/wikidata-uris.incl:

RewriteRule ^/graphql$ %{DOCUMENT_ROOT}/w/api.php?action=wbgraphql&format=json&origin=* [L]

But likely it doesn't end there, if further proxy or cache configurations are needed for grapqhl requests to be handled by API servers.

Event Timeline

Silvan_WMDE subscribed.

Tagging the SRE team here, maybe you'll be able to help us with this server config change for wikidata.org?

Hey folks, would it be possible to get some more detail about what assistance is required here? Is applying the rewrite rule the piece of work that requires SRE assistance? Thanks!

(Also, it would be helpful to know when this is required by. Cheers!)

Thanks for getting back on this. Yes, we need help with applying the rule, please: does the suggested rule in the task description look correct?

We're also not sure if there's anything else to watch out for: will GraphQL requests be routed to the right servers, even when they are coming in via the rewrite URL?

By when: we have announced the new API today and are using the Action API URL (i.e. the rewrite target) on the documentation page and inside the GraphQL web-client for now. Still, the new URL would be appreciated any time and would be much more user-friendly in the long term.

Blake triaged this task as Medium priority.Mar 5 2026, 5:04 PM

Hi :)

Depending on exactly what you want this rewrite to do, it may be that an apache rule isn't the right choice here.

We should schedule some time to discuss and try to align your requirements with the global API strategy work currently ongoing in WE5.2 (cc @HCoplin-WMF)

Hey @Clement_Goubert, I've chatted with Halley and we'll put this task away for now until things move forward with the work being done in WE5.2