For test app purposes, I created two shopify function extensions. I just use the default shopify app extensions generate and i wanted cart transform or discount with all default code + println
Yes you’re right! I did not register for discountApp. that’s the reason for discount but what about the cart transform? I also created cart transform but nothing was triggered?
Here’s the cart_transform_run.rs and graphql file (they’re the default code)
use super::schema;
use shopify_function::prelude::*;
use shopify_function::Result;
#[shopify_function]
fn cart_transform_run(
_input: schema::cart_transform_run::CartTransformRunInput,
) -> Result<schema::CartTransformRunResult> {
let _ = _input;
println!("cart_transform_run");
let no_changes = schema::CartTransformRunResult { operations: vec![] };
Ok(no_changes)
}
query CartTransformRunInput {
cart {
lines {
id
quantity
merchandise {
__typename
... on ProductVariant {
id
title
}
}
}
}
}