Getting Started with ScalarDB GraphQL
ScalarDB GraphQL is an interface layer that allows client applications to communicate with a ScalarDB database with GraphQL.
In this Getting Started guide, you will run a GraphQL server on your local machine.
Prerequisites
We assume you have already installed Docker and have access to a ScalarDB-supported database such as Cassandra. Please configure them first by following Getting Started with ScalarDB if you have not set them up yet.
You need a Personal Access Token (PAT) to access the Docker image of ScalarDB GraphQL in GitHub Container registry since the image is private. Ask a person in charge to get your account ready. Please read the official document for more detail.
Set up a database schema
We use the following simple example schema.
emoney.json
{
"emoney.account": {
"transaction": true,
"partition-key": [
"id"
],
"clustering-key": [],
"columns": {
"id": "TEXT",
"balance": "INT"
}
}
}
To apply the schema to your database, download the Schema Loader that matches the version you use from scalardb releases, and run the following command to load the schema.
$ java -jar scalardb-schema-loader-<version>.jar --config /path/to/database.properties -f emoney.json --coordinator