GraphQL client
You can use the graphql namespace of the Runnable API to make GraphQL queries from your Runnable code. GraphQL is a common way of exposing external APIs, and makes connecting to external services very straightforward.
- Rust
- AssemblyScript 🧪
- Swift 🧪
In Rust these methods are available under the graphql module:
# Use the "graphql" module
use suborbital::graphql;
# Invoke the "Query" method
graphql::query(…)
In TypeScript/AssemblyScript all methods are prefixed with graphQL:
// Import then invoke "Get" method
import { graphQLQuery } from '@suborbital/suborbital'
graphQLQuery(…)
Swift support is coming soon
The following namespace methods are available:
QUERY​
Performs a graphQL query:
- Rust
- AssemblyScript 🧪
- Swift 🧪
pub fn query(endpoint: &str, query: &str) -> Result<Vec<u8>,super::runnable::RunErr>
function graphQLQuery(endpoint: string, query: string): ArrayBuffer
Swift support is coming soon