Skip to main content

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.

In Rust these methods are available under the graphql module:

# Use the "graphql" module
use suborbital::graphql;

# Invoke the "Query" method
graphql::query()

The following namespace methods are available:

QUERY

Performs a graphQL query:

STATUS: STABLE
pub fn query(endpoint: &str, query: &str) -> Result<Vec<u8>,super::runnable::RunErr>