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§
- Generate the types to interact with Shopify’s API.
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§
- Marks a function as a Shopify Function entry point.
- Generates code for a Function using an explicitly-named target. This will: