Playing with CosmosDB and GraphQL
To try, first create a CosmosDB account that has a Database with name "PlantsTracker" and container with name "plants"
Then run
./gradlew run --args="--cosmosDBAccountEndpoint COSMOS_DB_ACCOUNT_ENDPOINT --cosmosDBAccountKey COSMOS_DB_ACCOUNT_KEY --cosmosDBPreferredRegions COSMOS_DB_ACCOUNT_PREFERRED_REGION1,COSMOS_DB_ACCOUNT_PREFERRED_REGION2"
Navigate to http://localhost:8080/
and try out the following queries
mutation {
createPlant(input: { plant: {
id: "ptracker:plant:myplant",
name: "MyPlant"
}}) {
name
}
}
{
getPlant(input: { id: "ptracker:plant:myplant"}) {
name
}
}
mutation {
updatePlant(input: { plant: {
id: "ptracker:plant:myplant",
name: "MyPlantUpdated"
}, shouldUpsert: true}) {
name
}
}
{
getPlant(input: { id: "ptracker:plant:myplant"}) {
name
}
}
mutation {
deletePlant(input: { id: "ptracker:plant:myplant"}) {
_
}
}
{
getPlant(input: { id: "ptracker:plant:myplant"}) {
name
}
}