-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add discounts allocator function template (Rust, JS/TS, WASM) #431
Conversation
7fec240
to
958902c
Compare
958902c
to
eba582e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny change requested
@@ -0,0 +1,7 @@ | |||
query RunInput { | |||
shop { | |||
metafield(namespace: "$app:{{handle | replace: " ", "-" | downcase}}", key: "allocator-function") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for other functions we've been using the key function-configuration
, which I think makes the intent clearer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
@@ -0,0 +1,7 @@ | |||
query Input { | |||
shop { | |||
metafield(namespace: "$app:{{handle | replace: " ", "-" | downcase}}", key: "allocator-function") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment re: key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have different wasm
contents compared to other discount functions? 🤔
Other functions only have locales
dir, run.graphql.liquid
, schema.graphql
and shopify.extension.toml.liquid
discounts/rust/discounts-allocator/default/shopify.extension.toml.liquid
Outdated
Show resolved
Hide resolved
Will check it out, I thought I trimmed it to match but could have missing something! :D |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎩 and got all sample functions 🎉
What are we solving?
Part of https://github.com/Shopify/core-issues/issues/64459
What was done
🎩 Instructions
spin up discount-functions-testing:legacy -c partners.branch=mathiusj/gh-64459-add-discounts-allocator-extension
For each Programming Language (JS, TS, Rust, WASM)
npm run shopify app generate extension -- --template discounts_allocator --name discounts-allocator-test --clone-url https://github.com/Shopify/function-examples\#mathiuss/add-discounts-allocator
yarn && yarn test
orcargo build && cargo test