@apollo/query-planner-wasm
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -7,7 +7,7 @@ { | ||
"description": "Bridge code written in Rust to Javascript/Typescript, to be internally used by Apollo Gateway. This package is not meant to be independently consumed.", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"license": "MIT/Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/apollographql/rust" | ||
"url": "https://github.com/apollographql/federation" | ||
}, | ||
@@ -21,4 +21,4 @@ "files": [ | ||
"main": "query_planner_wasm.js", | ||
"homepage": "https://github.com/apollographql/rust", | ||
"homepage": "https://github.com/apollographql/federation", | ||
"types": "query_planner_wasm.d.ts" | ||
} |
@@ -11,4 +11,5 @@ /* tslint:disable */ | ||
* @param {string} query | ||
* @param {any} options | ||
* @returns {any} | ||
*/ | ||
export function getQueryPlan(planner_ptr: number, query: string): any; | ||
export function getQueryPlan(planner_ptr: number, query: string, options: any): any; |
@@ -39,14 +39,2 @@ let imports = {}; | ||
function dropObject(idx) { | ||
if (idx < 36) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
@@ -71,6 +59,2 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachegetInt32Memory0 = null; | ||
@@ -83,2 +67,18 @@ function getInt32Memory0() { | ||
} | ||
function dropObject(idx) { | ||
if (idx < 36) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
} | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
/** | ||
@@ -93,12 +93,24 @@ * @param {string} schema | ||
let stack_pointer = 32; | ||
function addBorrowedObject(obj) { | ||
if (stack_pointer == 1) throw new Error('out of js stack'); | ||
heap[--stack_pointer] = obj; | ||
return stack_pointer; | ||
} | ||
/** | ||
* @param {number} planner_ptr | ||
* @param {string} query | ||
* @param {any} options | ||
* @returns {any} | ||
*/ | ||
module.exports.getQueryPlan = function(planner_ptr, query) { | ||
var ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.getQueryPlan(planner_ptr, ptr0, len0); | ||
return takeObject(ret); | ||
module.exports.getQueryPlan = function(planner_ptr, query, options) { | ||
try { | ||
var ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.getQueryPlan(planner_ptr, ptr0, len0, addBorrowedObject(options)); | ||
return takeObject(ret); | ||
} finally { | ||
heap[stack_pointer++] = undefined; | ||
} | ||
}; | ||
@@ -111,2 +123,11 @@ | ||
module.exports.__wbindgen_json_serialize = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
var ret = JSON.stringify(obj === undefined ? null : obj); | ||
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
getInt32Memory0()[arg0 / 4 + 1] = len0; | ||
getInt32Memory0()[arg0 / 4 + 0] = ptr0; | ||
}; | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -113,0 +134,0 @@ takeObject(arg0); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
733992
138