Skip to content

Commit

Permalink
Workaround for async-graphql#900
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhenrymantilla committed Jul 4, 2022
1 parent e839ffa commit 572ed3f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ async-graphql-value = { path = "value", version = "4.0.4" }
async-stream = "0.3.0"
async-trait = "0.1.48"
bytes = { version = "1.0.1", features = ["serde"] }
fix-hidden-lifetime-bug = "0.2.4" # See #900
fnv = "1.0.7"
futures-util = { version = "0.3.0", default-features = false, features = [
"io",
Expand Down
1 change: 1 addition & 0 deletions derive/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ pub fn generate(interface_args: &args::Interface) -> GeneratorResult<TokenStream
let schema_ty = oty.value_type();

methods.push(quote! {
#[crate_name::fix_hidden_lifetime_bug] // See #900
#[inline]
pub async fn #method_name<'ctx>(&self, #(#decl_params),*) -> #crate_name::Result<#ty> {
match self {
Expand Down
1 change: 1 addition & 0 deletions derive/src/simple_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ pub fn generate(object_args: &args::SimpleObject) -> GeneratorResult<TokenStream
getters.push(quote! {
#[inline]
#[allow(missing_docs)]
#[#crate_name::fix_hidden_lifetime_bug] // See #900
#vis async fn #ident(&self, ctx: &#crate_name::Context<'_>) -> #crate_name::Result<#ty> {
::std::result::Result::Ok(#block)
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ pub use async_graphql_value::{
pub use async_stream;
#[doc(hidden)]
pub use async_trait;
#[doc(hidden)]
pub use ::fix_hidden_lifetime_bug::fix_hidden_lifetime_bug;
pub use base::{
ComplexObject, Description, InputObjectType, InputType, InterfaceType, ObjectType,
OneofObjectType, OutputType, TypeName, UnionType,
Expand Down

0 comments on commit 572ed3f

Please sign in to comment.