How to apply alias in @key field in apollo federation
vasu-rangpariya-yudiz opened this issue · 1 comments
vasu-rangpariya-yudiz commented
I have schema type as per below
type oPlayer @key(fields: "_id") @key(fields: "sFullName") { _id: ID sFullName: String }
But when I try to resolve It in different service with different field name it is not able to resolve the data
type oPlayer @key(fields: "iPlayerId:_id") { iPlayerId: ID }
But it gives error as per below
Error : GraphQLError: Cannot use alias "iPlayerId" in "iPlayerId: _id": aliases are not currently supported in @key
dariuszkuc commented
Hello 👋
Error message is pretty self explanatory, aliases are not supported by the @key
directive (@requires
/@provides
do not support aliases either).