Skip to main content

A Python client for Saola's GraphQL API

Project description

Saola GraphQL API client

This is a GraphQL client for Python based on the ariadne-codegen pip package. It is used to access the API at app.saola.sg.

The client provides a convenient way to interact with the Saola GraphQL API, allowing you to perform various queries and mutations related to users, connections, workspaces, chats, and sources.

The following GraphQL files are included in the client:

  • graphql/users.graphql: Contains queries and mutations related to users.
  • graphql/connections.graphql: Contains queries related to connections.
  • graphql/workspaces.graphql: Contains queries related to workspaces.
  • graphql/chats.graphql: Contains queries related to chats.
  • graphql/sources.graphql: Contains queries related to sources.

To add more queries and mutations, you can create new files with the .graphql extension in the graphql directory. Once you have added your new GraphQL files, run the ./run-codegen.sh script to generate the necessary client code.

Usage

To use the client, you can import the generated client class and use it to perform queries and mutations. Here is an example:

import jwt
from graphql_client import Client as SaolaGraphQLClient

access_token = "your_access_token"
jwt_payload = jwt.decode(access_token, options={"verify_signature": False})
user_id = jwt_payload.get("user_id")

client = SaolaGraphQLClient(
    url="https://api.saola.sg/v1/graphql",
    headers={"Authorization": f"Bearer {access_token}"},
)

current_user = client.get_current_user(id=user_id)
print(current_user)

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

saola_graphql_client-0.0.5.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saola_graphql_client-0.0.5-py3-none-any.whl (24.9 kB view details)

Uploaded Python 3

File details

Details for the file saola_graphql_client-0.0.5.tar.gz.

File metadata

  • Download URL: saola_graphql_client-0.0.5.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for saola_graphql_client-0.0.5.tar.gz
Algorithm Hash digest
SHA256 f7e977d3ad62224d245c7cf68709da496bcd7d3fd36e003217542dec53d995a7
MD5 cd98408dc214514d082affff76f94ad3
BLAKE2b-256 eb59146db3927cc7cf758d38ffbd1825d96005390ce31a07dc03892d73a10234

See more details on using hashes here.

File details

Details for the file saola_graphql_client-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for saola_graphql_client-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b2fe686fb8a56f3f146992941769588e0b68105679b5a08c203493765d58e94e
MD5 e93375fc1acc7dc2617e11b1e69e95c8
BLAKE2b-256 a4eb105da0ec475b8adc3267eb76f40a7e0bc9f8049eafdd5272f4f584d54016

See more details on using hashes here.

Supported by

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