Skip to content

Commit 5af59e2

Browse files
committed
add Advnaced Usage to README.md
1 parent 031b75b commit 5af59e2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,37 @@ asyncio.run(client.subscribe(query=query, handle=print))
7272
# ...
7373
```
7474

75+
## Advanced Usage
76+
77+
### Disable SSL verification
78+
79+
Set `options` to `{"verify": False}` ether when instantiating the `GraphqlClient` class.
80+
81+
```py
82+
from python_graphql_client import GraphqlClient
83+
84+
client = GraphqlClient(endpoint="wss://www.your-api.com/graphql", options={"verify": False})
85+
```
86+
87+
Alternatively, you can set it when calling the `execute` method.
88+
89+
```py
90+
from python_graphql_client import GraphqlClient
91+
92+
client = GraphqlClient(endpoint="wss://www.your-api.com/graphql"
93+
client.execute(query="<Your Query>", options={"verify": False}))
94+
```
95+
96+
### Custom Authentication
97+
98+
```py
99+
from requests.auth import HTTPBasicAuth
100+
from python_graphql_client import GraphqlClient
101+
102+
auth = HTTPBasicAuth('fake@example.com', 'not_a_real_password')
103+
client = GraphqlClient(endpoint="wss://www.your-api.com/graphql", auth=auth)
104+
```
105+
75106
## Roadmap
76107

77108
To start we'll try and use a Github project board for listing current work and updating priorities of upcoming features.

0 commit comments

Comments
 (0)