From 15cae797b5512043193a00a8ae38370fa0817d6e Mon Sep 17 00:00:00 2001 From: qlient-org <90476638+qlient-org@users.noreply.github.com> Date: Mon, 1 Aug 2022 12:02:18 +0200 Subject: [PATCH] docs(qlient): Update qlient.md --- .../code/language-support/python/client/qlient.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/content/code/language-support/python/client/qlient.md b/src/content/code/language-support/python/client/qlient.md index b5d2cab06c..16f3630d4b 100644 --- a/src/content/code/language-support/python/client/qlient.md +++ b/src/content/code/language-support/python/client/qlient.md @@ -15,10 +15,10 @@ pip install qlient Create a `swapi_client_example.py` file with this content: -```python -from qlient import Client, GraphQLResponse +````python +from qlient.http import HTTPClient, GraphQLResponse -client = Client("https://swapi-graphql.netlify.app/.netlify/functions/index") +client = HTTPClient("https://swapi-graphql.netlify.app/.netlify/functions/index") res: GraphQLResponse = client.query.film( # swapi graphql input fields @@ -28,10 +28,10 @@ res: GraphQLResponse = client.query.film( _fields=["id", "title", "episodeID"] ) -print(res.query) # query film($id: ID) { film(id: $id) { id title episodeID } } -print(res.variables) # {'id': 'ZmlsbXM6MQ=='} +print(res.request.query) # query film($id: ID) { film(id: $id) { id title episodeID } } +print(res.request.variables) # {'id': 'ZmlsbXM6MQ=='} print(res.data) # {'film': {'id': 'ZmlsbXM6MQ==', 'title': 'A New Hope', 'episodeID': 4}} -``` +```` Close the file and run it using python: