Async-graphql: Does a MergedObject support merging objects with explicit lifetime parameters?

Created on 3 Nov 2020  路  3Comments  路  Source: async-graphql/async-graphql

I am attempting to create a MergedObject from two objects (a SimpleObject, and an Object) with explicit lifetime parameters; however, this fails to compile with "implicit elided lifetime not allowed here". Removing the #[derive(MergedObject)] will allow the crate to compile. Does this mean that MergedObjects cannot support explicit lifetimes? (I checked the book, but I didn't see this as a restriction of MergedObjects, so I wonder if maybe I am just doing something wrong.)

Some example code:

#[derive(SimpleObject)]
struct ObjectA<'a> {
     field_a: &'a str
}

#[derive(SimpleObject)]
struct ObjectB<'a> {
    field_b: &'a str
}

#[derive(MergedObject)] # fails with "implicit elided lifetime not allowed here"
pub struct Object<'a>(ObjectA<'a>, ObjectB<'a>);
question

Most helpful comment

All 3 comments

I will solve this problem later.

Awesome! Thanks for the super quick resolution :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TsumiNa picture TsumiNa  路  5Comments

chipsenkbeil picture chipsenkbeil  路  4Comments

Weasy666 picture Weasy666  路  4Comments

mwilliammyers picture mwilliammyers  路  3Comments

elertan picture elertan  路  5Comments