Skip to content

Latest commit

History

26 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

python-graphql-client

Simple GraphQL client for Python 2.7+

Install

pip install graphqlclient

Usage

fromgraphqlclientimportGraphQLClientclient=GraphQLClient('http://graphql-swapi.parseapp.com/')
result=client.execute('''{ allFilms { films { title } }}''')
print(result)

Authorization

Authorization tokens can be added to the request using the client's inject_token method:

client.inject_token('very-long-and-secure-token')

which defaults to http header name Authorization. An alternative http header name for the token can be set by passing in the alternative header name, e.g. for x-api-key:

client.inject_token('very-long-and-secure-token','x-api-key')

License

MIT License

About

Simple GraphQL client for Python 2.7+

Topics

Resources

Stars

155 stars

Watchers

11 watching

Forks

Releases

Packages

Used by

Contributors

Languages