Mutation between two microservices on Apollo Federation

1.4k views Asked by At

I'm using Apollo Federation to handle a lot of GraphQL microservices. I want to create a Notificaction when a user was followed so I need to send a mutation from UserService to NotificationService. How can I achieve this?

Thank you in advance!

1

There are 1 answers

0
deathangel908 On BEST ANSWER

I believe there's no way to make mutation work across multiples microservices. The only thing i can think of, is to always resolve some field in response and create a resolver in Notification MS. But that sounds more like a hack than a architecture solution.

This is especially done because apollo doesn't have any transaction system, which is not required in case of queries, but does require for mutations.

You should stick to default message exchange between microserivces, either an event bus (like kafka, or rabbitmq) or simple http api.