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`.
2828
2929The example below shows how you can execute queries against a local schema.
3030
31-
3231``` python
3332from gql import gql, Client
3433
@@ -41,24 +40,15 @@ query = gql('''
4140
4241client.execute(query)
4342```
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:
4545
4646``` python
47- from gql import gql, Client
47+ from gql import Client
4848from gql.transport.requests import RequestsHTTPTransport
4949
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)
6252```
6353
6454## License
You can’t perform that action at this time.
0 commit comments