Skip to content

Commit a4fcb89

Browse files
Merge branch 'main' into kos/update_discounts_tutorial_app
2 parents 685905e + 4098d6c commit a4fcb89

File tree

282 files changed

+41225
-8251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

282 files changed

+41225
-8251
lines changed

.graphqlrc.cjs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Configures the GraphQL language server for all the function schemas in this repo.
3+
*/
4+
const fs = require('node:fs');
5+
6+
function getProjects(path) {
7+
const projects = {}
8+
9+
const extensions = fs.readdirSync(`./${path}`);
10+
for (const entry of extensions) {
11+
const extensionPath = `./${path}/${entry}`;
12+
const schema = `${extensionPath}/schema.graphql`;
13+
if(!fs.existsSync(schema)) {
14+
continue;
15+
}
16+
17+
const projectName = extensionPath.substring(2).replaceAll('/', '-');
18+
projects[projectName] = {
19+
schema,
20+
documents: `${extensionPath}/input.graphql`
21+
}
22+
}
23+
24+
return projects;
25+
}
26+
27+
const projects = {
28+
...getProjects("sample-apps/discounts-tutorial/extensions"),
29+
...getProjects("checkout/rust/delivery-customization"),
30+
...getProjects("checkout/rust/payment-customization"),
31+
...getProjects("discounts/rust/order-discounts"),
32+
...getProjects("discounts/rust/product-discounts"),
33+
...getProjects("discounts/rust/shipping-discounts"),
34+
}
35+
36+
module.exports = {
37+
projects
38+
};

.vscode/settings.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"rust-analyzer.linkedProjects": [
3+
"checkout/rust/delivery-customization/default/Cargo.toml",
4+
"checkout/rust/payment-customization/default/Cargo.toml",
5+
"discounts/rust/order-discounts/default/Cargo.toml",
6+
"discounts/rust/order-discounts/fixed-amount/Cargo.toml",
7+
"discounts/rust/product-discounts/default/Cargo.toml",
8+
"discounts/rust/product-discounts/fixed-amount/Cargo.toml",
9+
"discounts/rust/shipping-discounts/default/Cargo.toml",
10+
"discounts/rust/shipping-discounts/fixed-amount/Cargo.toml",
11+
"sample-apps/discounts-tutorial/extensions/volume/Cargo.toml"
12+
]
13+
}
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[package]
2-
name = "shipping-discount"
2+
name = "{{name | replace: " ", "-" | downcase}}"
33
version = "1.0.0"
44
edition = "2021"
55

66
[dependencies]
77
serde = { version = "1.0.13", features = ["derive"] }
8-
serde_with = "1.13.0"
98
serde_json = "1.0"
9+
shopify_function = { version = "0.2.3" }
10+
graphql_client = { git = "https://github.com/graphql-rust/graphql-client" }
1011

1112
[profile.release]
1213
lto = true
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
query Input {
2+
cart {
3+
lines {
4+
quantity
5+
}
6+
}
7+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"schemaVersions":{"checkout_validation":{"major":1,"minor":0}}}

0 commit comments

Comments
 (0)