I’m running TG 3.1.2 Docker container and am seeing unexpected behavior with interpreted query.
Interpreted query HTTP call:
curl --user tigergraph:tigergraph -X POST 'http://localhost:14240/gsqlserver/interpreted_query?v1=Foo123&v2=Bar123' -d ' INTERPRET QUERY (VERTEX<Foo> v1, VERTEX<Bar> v2) FOR GRAPH TestGraph { INSERT INTO EDGE FooBar VALUES (v1, v2); PRINT "success"; } '
Output:
{"version":{"edition":"enterprise","api":"v2","schema":0},"error":true,"message":"Failed to convert Bar vertex id for parameter v2","code":"GSQL-2500"}
I expected to see output with “success”.
Here is other evidence that this should work…
- The vertices exist:
curl localhost:9000/graph/TestGraph/vertices/Foo/Foo123
Output:
{"version":{"edition":"enterprise","api":"v2","schema":0},"error":false,"message":"","results":[{"v_id":"Foo123","v_type":"Foo","attributes":{"unit_test":"Foo123","Prop1":10}}]}
curl localhost:9000/graph/TestGraph/vertices/Bar/Bar123
Output:
{"version":{"edition":"enterprise","api":"v2","schema":0},"error":false,"message":"","results":[{"v_id":"Bar123","v_type":"Bar","attributes":{"unit_test":"Bar123"}}]}
- I can successfully run the query from GraphStudio in interpreted mode:
can run interpreted mode from GraphStudio:
CREATE QUERY addEdgeIfVerticesExist(VERTEX<Foo> v1, VERTEX<Bar> v2) FOR GRAPH TestGraph { INSERT INTO EDGE FooBar VALUES (v1, v2); PRINT "success"; }
Output when run:
[ { "success": "success" } ]
- I can also install the above query from GraphStudio and run it successfully via RESTPP endpoint:
curl http://localhost:14240/restpp/query/TestGraph/addEdgeIfVerticesExist?v1=Foo123&v2=Bar123
Output when run:
{"version":{"edition":"enterprise","api":"v2","schema":0},"error":false,"message":"","results":[{"success":"success"}]}