Closed
Description
When writing an impl
block with the #[graphql_object]
attribute, declared lifetimes cannot be used in the return type. Example:
pub struct IndexGraph;
#[graphql_object(context = GraphQLContext)]
impl IndexGraph {
async fn fingerprint<'c>(&self, context: &'c GraphQLContext) -> &'c str {
context.index.fingerprint.as_str()
}
}
I get the following error: use of undeclared lifetime name 'c
in the return type.
The document states to use this syntax for lifetimes so I wonder if it's a bug or if there is another way to do this?
Using Juniper 0.15.9.