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