We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c26b51c commit 80ca5d9Copy full SHA for 80ca5d9
src/content/code/language-support/python/client/ariadne-codegen.md
@@ -42,14 +42,19 @@ $ ariadne-codegen
42
And use it in your Python projects:
43
44
```python
45
+import asyncio
46
from graphql_client import Client
47
-with Client("http://example.com/graphql/") as client:
48
- result = client.create_token(username="Admin", password="Example123)
+
49
+async def create_token_gql():
50
+ client = Client("http://example.com/graphql/")
51
+ result = await client.create_token(username="Admin", password="Example123")
52
53
if result.errors:
54
error = result.errors[0]
55
raise ValidationError({error.field: error.message})
56
- auth_token = result.token
-```
57
+ return result.token
58
59
+asyncio.run(create_token_gql())
60
+```
0 commit comments