I'm using a GraphQL federation architecture and I am trying to add a new field to an extended type. For example, imagine I have a type in a remote federated schema:
type Book {
id: ID!
authorFirstName: String
authorLastName: String
}
And I want to extend this type based on it's data, for example:
extend type Book @key(fields: "id") {
id: ID! @external
authorFullName: String
}
And in the resolver I will write:
Book: {
authorFullName: async (parent) => {
return `${parent.authorFirstName} ${parent.authorLastName}`
}
}
But unfortunately, it doesn't work. The extending schema only receives the ID and the __typename and nothing more. Do you know how can I receive not only the "id" but also other necessary fields?
Thanks alot!