@@ -108,6 +108,7 @@ var DgraphClientStub = (function () {
108108 return this . callAPI ( "alter" , __assign ( __assign ( { } , this . options ) , { method : "POST" , body : body } ) ) ;
109109 } ;
110110 DgraphClientStub . prototype . query = function ( req ) {
111+ var _a ;
111112 var headers = this . options . headers !== undefined
112113 ? __assign ( { } , this . options . headers ) : { } ;
113114 if ( req . vars !== undefined ) {
@@ -166,6 +167,12 @@ var DgraphClientStub = (function () {
166167 value : "true" ,
167168 } ) ;
168169 }
170+ if ( ( ( _a = req === null || req === void 0 ? void 0 : req . hash ) === null || _a === void 0 ? void 0 : _a . length ) > 0 ) {
171+ params . push ( {
172+ key : "hash" ,
173+ value : "" + req . hash ,
174+ } ) ;
175+ }
169176 if ( params . length > 0 ) {
170177 url += "?" ;
171178 url += params
@@ -179,6 +186,7 @@ var DgraphClientStub = (function () {
179186 return this . callAPI ( url , __assign ( __assign ( { } , this . options ) , { method : "POST" , body : req . query , headers : headers } ) ) ;
180187 } ;
181188 DgraphClientStub . prototype . mutate = function ( mu ) {
189+ var _a ;
182190 var body ;
183191 var usingJSON = false ;
184192 if ( mu . setJson !== undefined || mu . deleteJson !== undefined ) {
@@ -229,6 +237,11 @@ var DgraphClientStub = (function () {
229237 ( ! this . legacyApi ? "?startTs=" : "/" ) + mu . startTs . toString ( ) ;
230238 nextDelim = "&" ;
231239 }
240+ if ( ( ( _a = mu === null || mu === void 0 ? void 0 : mu . hash ) === null || _a === void 0 ? void 0 : _a . length ) > 0 ) {
241+ if ( ! this . legacyApi ) {
242+ url += nextDelim + "hash=" + mu . hash ;
243+ }
244+ }
232245 if ( mu . commitNow ) {
233246 if ( ! this . legacyApi ) {
234247 url += nextDelim + "commitNow=true" ;
@@ -241,6 +254,7 @@ var DgraphClientStub = (function () {
241254 headers : headers } ) ) ;
242255 } ;
243256 DgraphClientStub . prototype . commit = function ( ctx ) {
257+ var _a ;
244258 var body ;
245259 if ( ctx . keys === undefined ) {
246260 body = "[]" ;
@@ -251,12 +265,23 @@ var DgraphClientStub = (function () {
251265 var url = ! this . legacyApi
252266 ? "commit?startTs=" + ctx . start_ts
253267 : "commit/" + ctx . start_ts ;
268+ if ( ( ( _a = ctx === null || ctx === void 0 ? void 0 : ctx . hash ) === null || _a === void 0 ? void 0 : _a . length ) > 0 ) {
269+ if ( ! this . legacyApi ) {
270+ url += "&hash=" + ctx . hash ;
271+ }
272+ }
254273 return this . callAPI ( url , __assign ( __assign ( { } , this . options ) , { method : "POST" , body : body } ) ) ;
255274 } ;
256275 DgraphClientStub . prototype . abort = function ( ctx ) {
276+ var _a ;
257277 var url = ! this . legacyApi
258278 ? "commit?startTs=" + ctx . start_ts + "&abort=true"
259279 : "abort/" + ctx . start_ts ;
280+ if ( ( ( _a = ctx === null || ctx === void 0 ? void 0 : ctx . hash ) === null || _a === void 0 ? void 0 : _a . length ) > 0 ) {
281+ if ( ! this . legacyApi ) {
282+ url += "&hash=" + ctx . hash ;
283+ }
284+ }
260285 return this . callAPI ( url , __assign ( __assign ( { } , this . options ) , { method : "POST" } ) ) ;
261286 } ;
262287 DgraphClientStub . prototype . login = function ( userid , password , refreshToken ) {
0 commit comments