Skip to content

Commit 0580da8

Browse files
committed
Make README a bit more concise
1 parent 150eb3f commit 0580da8

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

README.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ GQL architecture is inspired by `React-Relay` and `Apollo-Client`.
2828

2929
The example below shows how you can execute queries against a local schema.
3030

31-
3231
```python
3332
from gql import gql, Client
3433

@@ -41,24 +40,15 @@ query = gql('''
4140

4241
client.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
4848
from 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

0 commit comments

Comments
 (0)