Skip to main content

Simple GraphQL client for Python 2.7+

Project description

python-graphql-client

Simple GraphQL client for Python 2.7+

Install

pip install graphqlclient

Usage

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:

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

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.4.tar.gz (2.6 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for graphqlclient-0.2.4.tar.gz
Algorithm Hash digest
SHA256 b3305f3df88c04839195754d409a49a2dc3adbcba4ebf9133b5663749e1dd92c
MD5 7891699c9691445434ad705fff99b51e
BLAKE2b-256 a7175914b77cc84c5e0bd8af54fedd2fac6cd34c6a14cb2231a02a58d51e2f7b

See more details on using hashes here.

Provenance

Supported by

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