One question I have is: When deleting a value, do we require the user to know the current value? In some other query language, this current value might not be required? Looking at your code and the following, it seems that the earlier deletes are now banned. (Also do make sure that the first query returns “Cars”. Sometimes I forget to restore.)
curl localhost:8080/query -XPOST -d '{
debug(_uid_: 0xc1cee22c7ab32e68 ) {
type.object.name.en
}
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d 'mutation {
delete {
_uid_:0xc1cee22c7ab32e68 <type.object.name.en> "random" .
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d '{
debug(_uid_: 0xc1cee22c7ab32e68 ) {
type.object.name.en
}
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d 'mutation {
set {
_uid_:0xc1cee22c7ab32e68 <type.object.name.en> "newcar3" .
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d '{
debug(_uid_: 0xc1cee22c7ab32e68 ) {
type.object.name.en
}
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d 'mutation {
delete {
_uid_:0xc1cee22c7ab32e68 <type.object.name.en> "random" .
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d '{
debug(_uid_: 0xc1cee22c7ab32e68 ) {
type.object.name.en
}
}
}' | python -m json.tool
Now, what if we ensure that the deletes go through. Do we still have panics?
curl localhost:8080/query -XPOST -d '{
debug(_uid_: 0xc1cee22c7ab32e68 ) {
type.object.name.en
}
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d 'mutation {
delete {
_uid_:0xc1cee22c7ab32e68 <type.object.name.en> "Cars" .
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d '{
debug(_uid_: 0xc1cee22c7ab32e68 ) {
type.object.name.en
}
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d 'mutation {
set {
_uid_:0xc1cee22c7ab32e68 <type.object.name.en> "newcar3" .
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d '{
debug(_uid_: 0xc1cee22c7ab32e68 ) {
type.object.name.en
}
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d 'mutation {
delete {
_uid_:0xc1cee22c7ab32e68 <type.object.name.en> "newcar3" .
}
}' | python -m json.tool
curl localhost:8080/query -XPOST -d '{
debug(_uid_: 0xc1cee22c7ab32e68 ) {
type.object.name.en
}
}
}' | python -m json.tool
This time, instead of getting panics, we see that the last query returns newcar3 instead of nothing. The panic got converted into a logic error? (as you were saying yesterday)