You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: shopify_function/README.md
+34-33Lines changed: 34 additions & 33 deletions
Original file line number
Diff line number
Diff line change
@@ -4,57 +4,57 @@ A crate to help developers build [Shopify Functions].
4
4
5
5
## Dependencies
6
6
7
-
* Make sure you have `graphql_client` in your dependencies
7
+
- Make sure you have `graphql_client` in your dependencies
8
8
9
-
```
10
-
cargo add graphql_client@0.13.0
11
-
```
9
+
```
10
+
cargo add graphql_client@0.14.0
11
+
```
12
12
13
13
## Usage
14
14
15
-
* The [`generate_types`] macro allows you to generate structs based on your [input query]. It will also generate output/response types for the current Function API, based on the provided schema.
16
-
* It will automatically generate an `.output.graphql` file for code generation purposes. This file can be added to your `.gitignore`.
17
-
* The [`shopify_function`] attribute macro marks the following function as the entry point for a Shopify Function. It manages the Functions `STDIN` input parsing and `STDOUT` output serialization for you.
18
-
* The [`run_function_with_input`] function is a utility for unit testing which allows you to quickly add new tests based on a given JSON input string.
15
+
- The [`generate_types`] macro allows you to generate structs based on your [input query]. It will also generate output/response types for the current Function API, based on the provided schema.
16
+
- The [`shopify_function`] attribute macro marks the following function as the entry point for a Shopify Function. It manages the Functions `STDIN` input parsing and `STDOUT` output serialization for you.
17
+
- The [`run_function_with_input`] function is a utility for unit testing which allows you to quickly add new tests based on a given JSON input string.
19
18
20
19
See the [example] for details on usage, or use the following guide to convert an existing Rust-based function.
21
20
22
21
## Updating an existing function to use `shopify_function`
You can also use the [cargo-expand](https://github.com/dtolnay/cargo-expand) crate to view the generated source, or use the [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) VSCode extension to get [IntelliSense](https://code.visualstudio.com/docs/editor/intellisense) for Rust and the generated types.
0 commit comments