How can I create an entity fetcher for an interface? Also using existing batch data loader if possible. #1536
-
For our location service our schema looks like this
Dgs class like so
In a different subgraph we have a type that has a property queryLocation: Location Our old original graph built on bare bones graphql java does this to federate the Location interface
How can I federate the Location interface in dgs? Preferably with a batch data loader if possible that will hook into the existing city and state batch data loader? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey @SaranSundar what you have so far is looking like a great start and matches what is mentioned in the Federation documentation. You need an entity fetcher for every concrete type that implements If you try the "Testing a Federated query", writing a federated query against your |
Beta Was this translation helpful? Give feedback.
Ah thanks i found out i don't to create a seperate entity fetcher for Location, apollo graph gateway first resolves interfaces into a type before resolving the type