Search code examples
ibm-cloudgraph-databasesgremlinibm-graph

Getting an Error when I make this gremlin query in IBM Graph service on bluemix


When I issue this gremlin query using IBM Graph's gremlin endpoint I get an error

curl -u username:password -H 'Content-Type: application/json' -d '{"gremlin": "g = graph.traversal(); g.V(4144)"}' -X POST "http://../g/gremlin"

Any thoughts?


Solution

  • In IBM Graph, it's required that you explicitly declare all variables in a gremlin query before using them. So the above query should look something like that :

    curl -u username:password -H 'Content-Type: application/json' -d '{"gremlin": "def g = graph.traversal(); g.V(4144)"}' -X POST "http://../g/gremlin"