'Resolve Same Entity in Different Services
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?
Solution 1:[1]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Supperhero |