I was looking into apollo federation but was not able to deduce from a first scan of their docs if I will be able to respond from the router with union of responses from two different subgraphs.
For example, I have two responses from subgraph A=[1,4,6,2,9] and B=[5,3]. Now if I query for the first 5 entries, my router should return [1,2,3,4,5].
Can this kind of responses union be achieved using apollo federation? If not, is there any other preferred way to achieve this?
Example use case: Take the example of bank transactions. There are two types of txs: deposit and withdraw. I have a deposit service which keeps track of all the deposit txs and a withdraw service to keep track of all the withdraw txs. I want to implement a service in front of these two services which when queried for txs of a particular account number will return me both the deposit and withdraw txs in chronological order in a single array. Assuming deposit and withdraw services have their own graphQL interface, what tools can I use to build this gateway service in front of them?