How to use Apollo client for micro frontends

Need a idea how we would be using apollo client in a micro frontend architecture .

The process that used to work :
I. Create a client in Container app responsible for login and logout.
2. share the token to MFE ( don not contain login and logout).
3. create a new Authlink in MFE and pass authorization token got from Container and create a new client

New development :
Some architectural changes has been done and no more we can share the token as token it set to header though some wrapper apolloprovider package which has method for login and logout and container app uses these methods to login and the auth header gets set , but my mfe cannot have login functionality as the parent already does it so the auth header is missing in the MFE apollo client.
so the graphql call from MFE would fail as they are having different client and MFE client does not have auth header.

please suggest a solution for it.

P.S hope ths issue is clear :sweat_smile:

1 Like