How to merge types when moving to apollo federation?

I am moving to apollo federation. I am having multiple services which is now pushing schema to apollo studio. I can see federated schema there. I am confused at one case where I have following types.

type Purchase @key(fields: "id anotherRefrenceType oneMoreId") {
    id: ID!
    anotherRefrenceType: String
    oneMoreId: String
    extraField: String
}

now I have another type*(Inside another service)* which is

extend type Purchase @key(fields: "id anotherRefrenceType { id refCode}") {
  id: ID! @external
  anotherRefrenceType: String @external
}

This was working fine while I was not using federation. When this schema is pushed in apollo-studio for federation, It is giving me error for invalid @key directive. If I update my extended type to

extend type Purchase @key(fields: "id anotherRefrenceType oneMoreId") {
  id: ID! @external
  anotherRefrenceType: String @external
  oneMoreId: String
}

graphql query fails. What is correct way to update this?

Hi @gauravsc, below is a link to documentation that provides guidance around using the @key directive for a single key, multiple keys, and “compound” key defination in a federated graphql setup.