[GitHub] Add URL query for sharing GraphQL+- queries

Moved from GitHub ratel/171

Posted by MichelDiz:

A simple and easy way to share queries is via URL querying. This is useful to ask for help sharing the URL and not run into problems with incompatible characters added by some sanitizing process (e.g. Discuss adds some characters sometimes that isn’t compatible with Ratel o Dgraph’s parser).

We could optionally use something like a base64 URL query instead of giant URLs like the examples below.


http://graphql.org/swapi-graphql?query={ %20%20allFilms{ %20%20%20%20edges%20{ %20%20%20%20%20%20node%20{ %20%20%20%20%20%20%20%20id %20%20%20%20%20%20} %20%20%20%20} %20%20} }

SPARQL https://query.wikidata.org/#%23Cats SELECT%20%3Fitem%20%3FitemLabel%20 WHERE%20 { %20%20%3Fitem%20wdt%3AP31%20wd%3AQ146. %20%20SERVICE%20wikibase%3Alabel%20{%20bd%3AserviceParam%20wikibase%3Alanguage%20"[AUTO_LANGUAGE]%2Cen".%20} }