diff --git a/Cargo.lock b/Cargo.lock index 2b36c62..8bef8b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,9 +49,9 @@ dependencies = [ [[package]] name = "async-graphql" -version = "1.16.5" +version = "1.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3846fd4346d044e86880734d4b8d1823f6a460c451a9c07df54ff88d99bb45" +checksum = "a4131ebe2fa846763a6593cad00abb2c3e662fd4cd2d39aad644649dbcf8ebf3" dependencies = [ "Inflector", "anyhow", diff --git a/codegen-for-async-graphql-example/Cargo.toml b/codegen-for-async-graphql-example/Cargo.toml index c23b55c..138b1db 100644 --- a/codegen-for-async-graphql-example/Cargo.toml +++ b/codegen-for-async-graphql-example/Cargo.toml @@ -10,5 +10,5 @@ repository = "https://github.com/atsuhiro/codegen-for-async-graphql" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-graphql = "1.15.14" +async-graphql = "1.16.6" async-std = { version = "1.5.0", features = ["attributes"] } diff --git a/codegen-for-async-graphql-example/src/models/object_type/create_friend_mutation_payload.rs b/codegen-for-async-graphql-example/src/models/object_type/create_friend_mutation_payload.rs index e6242d4..7685618 100644 --- a/codegen-for-async-graphql-example/src/models/object_type/create_friend_mutation_payload.rs +++ b/codegen-for-async-graphql-example/src/models/object_type/create_friend_mutation_payload.rs @@ -6,6 +6,6 @@ pub struct CreateFriendMutationPayload {} #[Object] impl CreateFriendMutationPayload { pub async fn friend(&self, ctx: &Context<'_>) -> Friend { - ctx.data::().friend() + ctx.data_unchecked::().friend() } } diff --git a/codegen-for-async-graphql-example/src/models/object_type/friend_connection.rs b/codegen-for-async-graphql-example/src/models/object_type/friend_connection.rs index fbfa271..913cf73 100644 --- a/codegen-for-async-graphql-example/src/models/object_type/friend_connection.rs +++ b/codegen-for-async-graphql-example/src/models/object_type/friend_connection.rs @@ -8,7 +8,7 @@ pub struct FriendConnection { #[Object] impl FriendConnection { pub async fn nodes(&self, ctx: &Context<'_>) -> Vec { - ctx.data::().nodes() + ctx.data_unchecked::().nodes() } pub async fn total_count(&self) -> i32 { self.total_count.clone() diff --git a/codegen-for-async-graphql-example/src/models/object_type/me.rs b/codegen-for-async-graphql-example/src/models/object_type/me.rs index 20acdfb..12ca646 100644 --- a/codegen-for-async-graphql-example/src/models/object_type/me.rs +++ b/codegen-for-async-graphql-example/src/models/object_type/me.rs @@ -17,13 +17,13 @@ pub struct Me { #[Object] impl Me { pub async fn friends(&self, ctx: &Context<'_>, first: Option) -> FriendConnection { - ctx.data::().friends(first) + ctx.data_unchecked::().friends(first) } pub async fn notifications(&self, ctx: &Context<'_>) -> Option> { - ctx.data::().notifications() + ctx.data_unchecked::().notifications() } pub async fn search(&self, ctx: &Context<'_>, text: String) -> Option> { - ctx.data::().search(text) + ctx.data_unchecked::().search(text) } pub async fn id(&self) -> ID { self.id.clone() diff --git a/codegen-for-async-graphql-example/src/models/object_type/query.rs b/codegen-for-async-graphql-example/src/models/object_type/query.rs index 4259f9c..ba7de95 100644 --- a/codegen-for-async-graphql-example/src/models/object_type/query.rs +++ b/codegen-for-async-graphql-example/src/models/object_type/query.rs @@ -9,7 +9,7 @@ pub struct Query { impl Query { #[field(desc = "\"me: Single-line comment\"")] pub async fn me(&self, ctx: &Context<'_>) -> Me { - ctx.data::().me() + ctx.data_unchecked::().me() } pub async fn active(&self) -> bool { self.active.clone() diff --git a/codegen-for-async-graphql-renderer/Cargo.toml b/codegen-for-async-graphql-renderer/Cargo.toml index 0fb0ce3..b3a0347 100644 --- a/codegen-for-async-graphql-renderer/Cargo.toml +++ b/codegen-for-async-graphql-renderer/Cargo.toml @@ -14,7 +14,7 @@ categories = ["network-programming", "web-programming"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-graphql = "1.15.14" +async-graphql = "1.16.6" async-graphql-parser = "1.14.2" proc-macro2 = { version = "1.0", default-features = false } quote = "1.0.7" diff --git a/codegen-for-async-graphql-renderer/src/renderer/internal/field.rs b/codegen-for-async-graphql-renderer/src/renderer/internal/field.rs index 1f4929e..dad5a9e 100644 --- a/codegen-for-async-graphql-renderer/src/renderer/internal/field.rs +++ b/codegen-for-async-graphql-renderer/src/renderer/internal/field.rs @@ -93,7 +93,7 @@ impl Renderer { quote!( #field pub async fn #n(&self, ctx: &Context<'_>, #arguments ) -> #ty { - ctx.data::().#n(#arguments_variebles) + ctx.data_unchecked::().#n(#arguments_variebles) } ) }

AltStyle によって変換されたページ (->オリジナル) /