Crate shopify_function

source ·
Expand description

Crate to write Shopify Functions in Rust.

This crate provides some convenience when building Shopify Functions using Rust. The crate takes care of generating the required Rust structs to handle the data types being passed between Shopify and the Function. The crate also takes care of deserializing the input data and serializing the output data.

use shopify_function::prelude::*

generate_types!(query_path = "./input.graphql", schema_path = "./schema.graphql");

#[shopify_function]
fn function(input: input::ResponseData) -> Result<output::FunctionResult> {
    /* ... */
}

Modules§

Macros§

Functions§

  • Runs the given function f with the invocation payload, returning the deserialized output. This function is provided as a helper when writing tests.

Type Aliases§

Attribute Macros§