kirjava.py

The kirjava library.

class kirjava.Client(url)[source]

A GraphQL client. This is the object which sends requests to the GraphQL server.

The URL that serves the GraphQL content is given on creating the Client.

Parameters:
  • url (str) – The URL of the GraphQL server to interact with.
  • headers (dict) – Any additional HTTP headers.
execute(message, method='POST', variables=None)[source]

Sends a request to the GraphQL server.

Parameters:
  • message (str) – The query to make.
  • method (str) – By default, POST requests are sent, but this can be overriden here.
  • variables (dict) – Any GraphQL variables can be passed here.
Return type:

dict

headers

The HTTP headers that will be sent with every request.

Return type:dict
history

The queries sent, most recent first.

Return type:tuple
url

The URL of the GraphQL server to interact with.

Return type:str
kirjava.execute(url, *args, headers=None, **kwargs)[source]

Sends a GraphQL request without the user haveing to make a dedicated Client object.

Parameters:
  • url (str) – the URL to send to.
  • message (str) – The query to make.
  • method (str) – By default, POST requests are sent, but this can be overriden here.
  • headers (dict) – Any additional HTTP headers.
  • variables (dict) – Any GraphQL variables can be passed here.
Return type:

dict