Resolve Same Entity in Different Services

769 Views Asked by At

I have use-case where same entity type needs to resolved in multiple service, for example

Service A has type Post

type Post{
   id: ID!
   title: String 
}

Service B has same type Post

type Post{
   id: ID!
   title: String
}

I have used apollo federation directive such us shareable, but still apollo couldn't able to compose a graph, how can i achieve this?

1

There are 1 best solutions below

0
On

Have you read the documentation? You need to tag shared entities to tell apollo which one is extending which. Read through this. You said you've tried using shareable, but haven't provided an example. Probably you've used it incorrectly but that can't be seen from what you've provided. You should also provide whichever error you got when apollo failed to build a schema.