gremlin-serverless
A stateless Gremlin driver of Apache TinkerPop™ , optimized for serverless functions.
Installation
npm install gremlin-serverless --save
Introduction
gremlin-serverless is a simple wrapper of Websocket using rxjs observable.
Socket will close on error and success, this way serverless functions could execute a statless query.
Usage
Socket endpoint address should be provided with protocol, port and path embedded. Note the /gremlin
, see Revised URL for websockets in 3.2.2
; /** * Microsoft Azure exmaple * Gremlin Endpoint * https://exmaple.gremlin.cosmosdb.azure.com:443/ */const execute = ; const testmsg = requestId: uuid processor: "" op: "eval" args: gremlin: "g.V()" bindings: {} accept: "application/json" language: "gremlin-groovy" ;const result$ = const disposable = result$
Error handling
Server response with statuscode other than success will be treated as error, a 'response' property will contain the response.