After tapping the Start Server button you must wait a few seconds or minutes (depending on the size of your databases password size) for the server to start. Once the server is running you can send the API requests below to interact with the databases. You need to go into settings and generate an API key for your database in order to access it.
Test using postman:
API URL:
http://localhost:port/graphene
API Requests:
Every request must be of type POST. Below are the post request body to access each function.
View:
Returns an object with parsed .json contents. You will see that the only property that stored on the objects is "uuid". The reason being is that this are references not the actual Object. You must run this same option on the "uuid" of the object to view it's contents.
{
"query": "view",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry"
}
}
Insert:
If the value is a double, int, String or bool the insert method will add the key to the selected Map, if the key already exists the value will be replaced. If you you try to insert an object a new file will be created and a reference to the file will be generated. If the value you try to replace has an object assigned to it you will get an error (object references cannot be overwriten). You can also insert Lists/Arrays (arrays cannot have mixed data types).
{
"mutation": "insert",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry",
"key": "array",
"value": [1,2,3,4,5,6,7,8,9,10]
}
}
Delete:
If your delete target is an object reference(objectUUID) it finds the object on the List/Array and deletes the object and all linked/referenced objects(children).
{
"mutation": "delete",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry",
"key": "array",
"objectUUUID": "2025M3TQNB2X9SXAB1PBVGVY0BTA4G9P53382CM5"
}
}
Delete Key:
If your target is a String, bool, double or int, the property gets removed from the target object. If the target is an object reference, the reference, object and children will be removed.
{
"mutation": "deleteKey",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry",
"key": "My Hotel 01"
}
}
Pop:
If the key value is of type List it will remove the element at the specified index.
{
"mutation": "pop",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry",
"key": "array",
"index": 1
}
}
Insert at:
If the key value is a List the specified value will be inserted at the specified index.
{
"mutation": "insertAt",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry",
"key": "array",
"index": 1,
"value": [2]
}
}
Replace at:
Replaces the value at the specified index. Since objects store a reference to a file containing the entire object they cannot be replaced.
{
"mutation": "replaceAt",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry",
"key": "array",
"index": 1,
"value": [58]
}
}
Move:
Moves item on the list.
{
"mutation": "move",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry",
"key": "array",
"from": 1,
"to": 3
}
}
Swap:
Swaps the position of list items.
{
"mutation": "swap",
"variables": {
"accessToken": "YD2025EO32M63F1G5LBGXRYL7FD21NE3HOQ3LQH7",
"uuid": "entry",
"key": "array",
"from": 3,
"to": 1
}
}