From ca799d4bcac18e88068665625976cd661abe2fc3 Mon Sep 17 00:00:00 2001 From: Delta Pham Date: Thu, 30 Nov 2023 10:30:50 -0500 Subject: [PATCH 1/2] Bump version to 0.5.0 --- Cargo.lock | 4 ++-- example/Cargo.toml | 2 +- example_with_targets/Cargo.toml | 2 +- shopify_function/Cargo.toml | 4 ++-- shopify_function_macro/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0323609..b32584a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,7 +207,7 @@ dependencies = [ [[package]] name = "shopify_function" -version = "0.4.0" +version = "0.5.0" dependencies = [ "anyhow", "graphql_client", @@ -218,7 +218,7 @@ dependencies = [ [[package]] name = "shopify_function_macro" -version = "0.4.0" +version = "0.5.0" dependencies = [ "convert_case", "proc-macro2", diff --git a/example/Cargo.toml b/example/Cargo.toml index 2609e0b..7cfe1d9 100644 --- a/example/Cargo.toml +++ b/example/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license = "MIT" [dependencies] -shopify_function = { path = "../shopify_function", version = "0.4.0" } +shopify_function = { path = "../shopify_function", version = "0.5.0" } serde = { version = "1.0.13", features = ["derive"] } serde_json = "1.0" graphql_client = "0.13.0" diff --git a/example_with_targets/Cargo.toml b/example_with_targets/Cargo.toml index c81b261..7aaf873 100644 --- a/example_with_targets/Cargo.toml +++ b/example_with_targets/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" license = "MIT" [dependencies] -shopify_function = { path = "../shopify_function", version = "0.4.0" } +shopify_function = { path = "../shopify_function", version = "0.5.0" } serde = { version = "1.0.13", features = ["derive"] } serde_json = "1.0" graphql_client = "0.13.0" diff --git a/shopify_function/Cargo.toml b/shopify_function/Cargo.toml index 2ad5eac..fc8b844 100644 --- a/shopify_function/Cargo.toml +++ b/shopify_function/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shopify_function" -version = "0.4.0" +version = "0.5.0" edition = "2021" authors = ["Surma ", "Delta Pham "] license = "MIT" @@ -10,7 +10,7 @@ description = "Crate to write Shopify Functions in Rust." serde = { version = "1.0.13", features = ["derive"] } serde_json = "1.0" anyhow = "1.0.62" -shopify_function_macro = { version = "0.4.0", path = "../shopify_function_macro" } +shopify_function_macro = { version = "0.5.0", path = "../shopify_function_macro" } [dev-dependencies] graphql_client = "0.13.0" diff --git a/shopify_function_macro/Cargo.toml b/shopify_function_macro/Cargo.toml index 79782bf..4b9f830 100644 --- a/shopify_function_macro/Cargo.toml +++ b/shopify_function_macro/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "shopify_function_macro" -version = "0.4.0" +version = "0.5.0" edition = "2021" authors = ["Surma ", "Delta Pham "] license = "MIT" From 5fa77aeef46bd8c72f5f77cf05092a754a8ba4da Mon Sep 17 00:00:00 2001 From: Delta Pham Date: Thu, 30 Nov 2023 10:31:19 -0500 Subject: [PATCH 2/2] Add date and time scalars to example --- example_with_targets/a.graphql | 4 +++ example_with_targets/schema.graphql | 39 +++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/example_with_targets/a.graphql b/example_with_targets/a.graphql index 4b946a7..dfd76e4 100644 --- a/example_with_targets/a.graphql +++ b/example_with_targets/a.graphql @@ -2,4 +2,8 @@ query Input { id num name + date + dateTime + dateTimeWithoutTimezone + timeWithoutTimezone } diff --git a/example_with_targets/schema.graphql b/example_with_targets/schema.graphql index 660fba5..2f74d51 100644 --- a/example_with_targets/schema.graphql +++ b/example_with_targets/schema.graphql @@ -8,6 +8,34 @@ Only allow the field to be queried when targeting one of the specified targets. """ directive @restrictTarget(only: [String!]!) on FIELD_DEFINITION +""" +Represents an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-encoded date string. +For example, September 7, 2019 is represented as `"2019-07-16"`. +""" +scalar Date + +""" +Represents an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-encoded date and time string. +For example, 3:50 pm on September 7, 2019 in the time zone of UTC (Coordinated Universal Time) is +represented as `"2019-09-07T15:50:00Z`". +""" +scalar DateTime + +""" +A subset of the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format that +includes the date and time but not the timezone which is determined from context. + +For example, "2018-01-01T00:00:00". +""" +scalar DateTimeWithoutTimezone + +""" +A signed decimal number, which supports arbitrary precision and is serialized as a string. + +Example values: `"29.99"`, `"29.999"`. +""" +scalar Decimal + """ Represents a unique identifier, often used to refetch an object. The ID type appears in a JSON response as a String, but it is not intended to be human-readable. @@ -16,6 +44,13 @@ Example value: `"gid://shopify/Product/10079785100"` """ scalar ID +""" +A subset of the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format that +includes the time but not the date or timezone which is determined from context. +For example, "05:43:21". +""" +scalar TimeWithoutTimezone + """ A void type that can be used to return a null value from a mutation. """ @@ -28,6 +63,10 @@ type Input { id: ID! num: Int name: String + date: Date + dateTime: DateTime + dateTimeWithoutTimezone: DateTimeWithoutTimezone + timeWithoutTimezone: TimeWithoutTimezone targetAResult: Int @restrictTarget(only: ["test.target-b"]) }