I am trying to implement Graphql federation with multiple subgraphs using Nestjs + Apollo GraphQL.
So I have USER subgraph and Application subgraph as separate Graphql services. Everything seems to be working fine when its comes to querying from the supergraph.
But I am not able to figure out how to implement the following
As Application subgraph have the following mutation to add the new application
type Mutation {
createApplication(
createApplicationInput: CreateApplicationInput!
): Application!
}
input CreateApplicationInput {
name: String!
userId: Int!
}
Now while calling the above mutation I am able to add new application, but not able to validate if user exists on user subgraph or not.
So my question is how I can validate that user exists before insert to application at graphql side