Update GraphQL documentation

We don't use the `config/api.yml` file since commit c984e666f, and the
`.delete("\n").delete(" ")` in the code examples isn't necessary (we
should have probably added it in commit 56e42f209).

We're also changing the responses so there are no references to any
specific city.
This commit is contained in:
Javi Martín
2024-09-17 15:06:15 +02:00
parent d28854802e
commit a5aa39f6e2
4 changed files with 60 additions and 72 deletions

View File

@@ -4,7 +4,7 @@ API_ENDPOINT = "https://demo.consuldemocracy.org/graphql".freeze
def make_request(query_string)
uri = URI(API_ENDPOINT)
uri.query = URI.encode_www_form(query: query_string.delete("\n").delete(" "))
uri.query = URI.encode_www_form(query: query_string)
request = Net::HTTP::Get.new(uri)
request[:accept] = "application/json"