How to use entites to map one field name with another field name in graphql?

suppose consider,
i’m having two services named bats and balls, in that used entites of balls to fetch the data of balls in bats using the sharable, the real problem i’m facing is i need to have two more fields in the bat so that they can be mapped to the “customerid” which is a field in balls, how to map this thing???

I’m not sure I follow, can you provide the current schemas of the subgraphs as well as the desired ones? For instance you might say:

I have this

Balls Service

type Ball @shareable {
  id: ID!
}

Bats Service

type Bat @key(fields: "id") {
  id: ID!
  balls: [Ball!]!
}

type Ball @shareable {
  id: ID!
}

What I want is this

Balls Service

type Ball @key(fields: "id") {
  id: ID!
  customerid: ID!
}

Bats Service

type Bat @key(fields: "id") {
  id: ID!
  balls: [Ball!]!
}

type Ball @key(fields: "id") {
  id: ID!
}

For a faster response, you can also join our Discord, which I check much more frequently :grin:

1 Like