Skip to main content

Simple GraphQL client for Python 2.7+

Project description

# python-graphql-client
Simple GraphQL client for Python 2.7+

## Install

```sh
pip install graphqlclient
```

## Usage


```py
from graphqlclient import GraphQLClient

client = 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:

```py
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`:

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

## License

[MIT License](http://opensource.org/licenses/MIT)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphqlclient-0.2.3.tar.gz (2.6 kB view details)

Uploaded Source

File details

Details for the file graphqlclient-0.2.3.tar.gz.

File metadata

File hashes

Hashes for graphqlclient-0.2.3.tar.gz
Algorithm Hash digest
SHA256 0f6ad0885bada822e2637c4799b78dfa860ef1e30c7ff0bb40ecb41eb7fb6c15
MD5 c31c306458874804117af33759a073b9
BLAKE2b-256 7cf9bacfb9b851bad00b67017d745c491cca1d83be633e634dcb469c9c2979c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page