Skip to content

Commit 074f696

Browse files
committed
readme
1 parent 971fdb3 commit 074f696

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

README.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
11
# python-graphql-client
22
Simple GraphQL client for Python 2.7+
3+
4+
## Install
5+
6+
```sh
7+
pip install graphqlclient
8+
```
9+
10+
## Usage
11+
12+
13+
```py
14+
from graphqlclient import GraphQLClient
15+
16+
client = GraphQLClient('http://graphql-swapi.parseapp.com/')
17+
18+
result = client.execute('''
19+
{
20+
allFilms {
21+
films {
22+
title
23+
}
24+
}
25+
}
26+
''')
27+
28+
print(result)
29+
```
30+
31+
## License
32+
33+
[MIT License](http://opensource.org/licenses/MIT)

example_run.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
def main():
66
client = GraphQLClient('http://graphql-swapi.parseapp.com/')
77

8-
print(client.execute('''
8+
result = client.execute('''
99
{
1010
allFilms {
1111
films {
1212
title
1313
}
1414
}
1515
}
16-
'''))
16+
''')
17+
18+
print(result)
1719

1820
if __name__ == '__main__':
1921
main()

0 commit comments

Comments
 (0)