Unable to provide arrays as parameters in cosmos with gremlin: Gremlin Malformed Request: Unknown GraphSON type encountered

0

I'm using gremlin with Cosmos. The following works fine for simple queries:

const gremlin = require("gremlin");

const authenticator = new gremlin.driver.auth.PlainTextSaslAuthenticator(
  `/dbs/graph/colls/collection`,
  "PRIVATE KEY"
);
const client = new gremlin.driver.Client(
  "wss://mygraph.gremlin.cosmosdb.azure.com:443/gremlin",
  {
    authenticator,
    mimeType: "application/vnd.gremlin-v2.0+json",
    traversalSource: "g"
  }
);

client
  .submit("g.V()")
  .then(function(data) {
    console.log(data.toArray());
    client.close();
  })
  .catch(function(err) {
    console.log(err);
    client.close();
  });

However, when I try pass an array parameter:

client
  .submit("g.V().has('value', within(arrayParameter))", {
    arrayParameter: []
  })

I get the response:

ExceptionType : GraphMalformedException
ExceptionMessage :
        Gremlin Malformed Request: Unknown GraphSON type encountered: g:List. Path: 'args.bindings.anArray', Line: 1, Position: 215.
        GremlinRequestId : d3513f09-cf89-4d61-b2ac-31dbb60be085
        Context : graphcompute
        Scope : graphcomp-execquery
        GraphInterOpStatusCode : MalformedRequest
        HResult : 0x80131500

This worked fine with the previous v2 client. Cosmos doesn't support the bytecode mode.

javascript
gremlin
asked on Stack Overflow Jul 9, 2019 by Joe

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0