File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,6 @@ GQL architecture is inspired by `React-Relay` and `Apollo-Client`.
28
28
29
29
The example below shows how you can execute queries against a local schema.
30
30
31
-
32
31
``` python
33
32
from gql import gql, Client
34
33
@@ -41,24 +40,15 @@ query = gql('''
41
40
42
41
client.execute(query)
43
42
```
44
- The example below shows how you can execute queries against a local schema with additional headers
43
+
44
+ If you want to add additional headers when executing the query, you can specify these in a transport object:
45
45
46
46
``` python
47
- from gql import gql, Client
47
+ from gql import Client
48
48
from gql.transport.requests import RequestsHTTPTransport
49
49
50
-
51
- client = Client(transport = RequestsHTTPTransport(
52
- url = ' /graphql' ,
53
- headers = {' Authorization' : ' token' }),
54
- schema = schema)
55
- query = gql('''
56
- {
57
- hello
58
- }
59
- ''' )
60
-
61
- client.execute(query)
50
+ client = Client(transport = RequestsHTTPTransport(
51
+ url = ' /graphql' , headers = {' Authorization' : ' token' }), schema = schema)
62
52
```
63
53
64
54
## License
You can’t perform that action at this time.
0 commit comments