Initialize ApolloClient (iOS) with multiple endpoints

I have an iOS app which needs to hit two different endpoints to fetch data. How to initiate ApolloClient with two different endpoints? I couldn’t find a straight answer in internet, any help is appreciated.

Note: Those endpoints belongs to two different teams and there is no way they can give me a router api or something like that.
I also cannot make a separate module/package exclusively for these. It breaks our existing app’s architecture .

@Anil To handle multiple endpoints you will need an ApolloClient instance for each endpoint, this shouldn’t require separate modules/packages, you could generated the code for each schema into separate packages, but you can also generate it into the same target using the embeddedInTarget codegen config option (which I assume you may be already using)

1 Like