@suborbital/suborbital
Advanced tools
| import { graphql_query } from "./env"; | ||
| import { toFFI, ffi_result, getIdent } from "./ffi"; | ||
| // send a GraphQL query to the provided endpoint | ||
| export function graphQLQuery(endpoint: string, query: string): ArrayBuffer { | ||
| let endpointFFI = toFFI(String.UTF8.encode(endpoint)) | ||
| let queryFFI = toFFI(String.UTF8.encode(query)) | ||
| let result_size = graphql_query(endpointFFI.ptr, endpointFFI.size, queryFFI.ptr, queryFFI.size, getIdent()) | ||
| let result = ffi_result(result_size) | ||
| return result | ||
| } |
+2
-0
@@ -7,2 +7,4 @@ // returns a result to the host | ||
| export declare function fetch_url(method: i32, url_ptr: usize, url_size: i32, body_ptr: usize, body_size: i32, ident: i32): i32 | ||
| // makes a GraphQL request | ||
| export declare function graphql_query(endpoint_ptr: usize, endpoint_size: i32, query_ptr: usize, query_size: i32, ident: i32): i32 | ||
| // sets a value in the cache | ||
@@ -9,0 +11,0 @@ export declare function cache_set(key_ptr: usize, key_size: i32, value_ptr: usize, value_size: i32, ttl: i32, ident: i32): i32 |
@@ -5,3 +5,4 @@ export * from "./ffi" | ||
| export * from "./http" | ||
| export * from "./graphql" | ||
| export * from "./cache" | ||
| export * from "./request" |
+1
-1
| { | ||
| "name": "@suborbital/suborbital", | ||
| "version": "0.10.0", | ||
| "version": "0.11.0", | ||
| "types": "assembly/index.ts", | ||
@@ -5,0 +5,0 @@ "description": "Suborbital's Runnable API for AssemblyScript", |
8504
8.59%11
10%210
6.06%