Closed hchockarprasad closed 2 years ago
@key directive doesn't get applied on entities even when federation is enabled.
@key
This is the following code example that I tried.
#[derive(Debug, Clone, SimpleObject)] pub struct User { pub id: &'static str, pub name: &'static str, } #[Object(extends)] impl Query { pub async fn users(&self) -> Vec<User> { User::all() } #[graphql(entity)] pub async fn find_user_by_id(&self, #[graphql(key)] id: ID) -> User { User::find_by_id(id) } }
The exported SDL for the above User type is
type User { id: String!, name: String! }
whereas what I expect is
type User @key(fields: "id") { id: String!, name: String! }
Let me know if I am missing something..
https://github.com/async-graphql/async-graphql/issues/1028
@key
directive doesn't get applied on entities even when federation is enabled.This is the following code example that I tried.
The exported SDL for the above User type is
whereas what I expect is
Let me know if I am missing something..