GraphQL Python Client
Client access to the ObjectBox GraphQL database server
Last updated
Was this helpful?
Client access to the ObjectBox GraphQL database server
Last updated
Was this helpful?
Install a GraphQL client like "python-graphql-client":
Your ObjectBox Sync Server also comes with a native GraphQL server, making ObjectBox a GraphQL database that clients can query.
Note that the port used for GraphQL is different than the one used for Sync.
In order to make GraphQL requests, you must first obtain a session ID.
Make an empty plain HTTP POST request to /api/v2/sessions
in order to receive a session ID. E.g. using the library:
Now everything is ready for you to do the GraphQL requests. Note that the session ID you found in the previous step must be passed to all GraphQL requests. You can provide it via e.g. using argparse. It's passed via the standard Authorization
header (see example below).
Here is a simple example of using the client to read all existing objects from the database.