Skip to content

Commit 15cae79

Browse files
authored
docs(qlient): Update qlient.md
1 parent 231c7c5 commit 15cae79

File tree

1 file changed

+6
-6
lines changed
  • src/content/code/language-support/python/client

1 file changed

+6
-6
lines changed

src/content/code/language-support/python/client/qlient.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ pip install qlient
1515

1616
Create a `swapi_client_example.py` file with this content:
1717

18-
```python
19-
from qlient import Client, GraphQLResponse
18+
````python
19+
from qlient.http import HTTPClient, GraphQLResponse
2020

21-
client = Client("https://swapi-graphql.netlify.app/.netlify/functions/index")
21+
client = HTTPClient("https://swapi-graphql.netlify.app/.netlify/functions/index")
2222

2323
res: GraphQLResponse = client.query.film(
2424
# swapi graphql input fields
@@ -28,10 +28,10 @@ res: GraphQLResponse = client.query.film(
2828
_fields=["id", "title", "episodeID"]
2929
)
3030

31-
print(res.query) # query film($id: ID) { film(id: $id) { id title episodeID } }
32-
print(res.variables) # {'id': 'ZmlsbXM6MQ=='}
31+
print(res.request.query) # query film($id: ID) { film(id: $id) { id title episodeID } }
32+
print(res.request.variables) # {'id': 'ZmlsbXM6MQ=='}
3333
print(res.data) # {'film': {'id': 'ZmlsbXM6MQ==', 'title': 'A New Hope', 'episodeID': 4}}
34-
```
34+
````
3535

3636
Close the file and run it using python:
3737

0 commit comments

Comments
 (0)