kirjava.utilities
Useful functions.
- kirjava.utilities.create_response_error_message(response)[source]
Works out what to say about a response that isn’t JSON.
- Parameters
response – The HTTP response object.
- Return type
str
- kirjava.utilities.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
- kirjava.utilities.files_to_map(files)[source]
Takes a files dict and creates the map dict needed by the GraphQL file upload spec.
- Parameters
files (dict) – the files dict.
- Return type
dict