(input: input::ResponseData)
| 15 | |
| 16 | #[shopify_function_target(query_path = "src/run.graphql", schema_path = "schema.graphql")] |
| 17 | fn run(input: input::ResponseData) -> Result<output::FunctionRunResult> { |
| 18 | let no_discount = output::FunctionRunResult { |
| 19 | discounts: vec![], |
| 20 | discount_application_strategy: output::DiscountApplicationStrategy::FIRST, |
| 21 | }; |
| 22 | |
| 23 | let _config = match input.discount_node.metafield { |
| 24 | Some(input::InputDiscountNodeMetafield { value }) => Configuration::from_str(&value), |
| 25 | None => return Ok(no_discount), |
| 26 | }; |
| 27 | |
| 28 | Ok(output::FunctionRunResult { |
| 29 | discounts: vec![], |
| 30 | discount_application_strategy: output::DiscountApplicationStrategy::FIRST, |
| 31 | }) |
| 32 | } |
| 33 | |
| 34 | #[cfg(test)] |
| 35 | mod tests { |
nothing calls this directly
no outgoing calls
no test coverage detected