How to resolve two steps mutation between two services in sever side with Apollo federation

I want to resolve a two steps operation all on the server side of my Federation architecture.
Let’s say:

  • Apollo federation set up as gateway
  • service 1 saves data in database 1
  • service 2 saves data in database 2
    service 1 mutation resolver creates/save data in database 1 and returns a UUID;
    once data is created i need to save that UUID as reference in database 2 (which requires calling the mutation resolver in service 2).
    i want to solve all this in the server side.

the straight forward solution i can think of is:

  • once data has been created in database 1, make an http request to service 2 (Axios or Apollo Client) from service 1. This http should create data in database 2 by calling the resolver from service 2.

Is there a better way to solve in Apollo Federation?
Thank you,

1 Like

Hi @Alex found any solution on this? I am also looking for something similar and don’t want to orchestrate on client side :slight_smile: