Unable to use type declared in different sub graphs

Hi,
We are working on GraphQL POC, where we want to use the type declared in another subgraph. But we are unable to achieve it. Below is the scenario

Tech Stack: Java-17, Spring GraphQL

In the above example we are trying to use the Asset type from SubGraph-1 in SubGraph-2, We tried to hit query from Apollo Studio. But we are getting the Asset response as null.

Could you please help here, how we can configure resolvers in Java - Spring GraphQL.

Hello :wave:
I’m assuming you are running your queries through gateway/router. Without source code cannot say for certain, but it looks like you did not implement EmployeeInformation.assets resolver, i.e. subgraph 2 should return you a list of asset IDs. Router will then federate the call to subgraph 1 to get remaining data based on those IDs.

See GitHub - apollographql/federation-jvm-spring-example: Apollo Federation JVM example implementation using Spring for GraphQL for example integration.

Thanks,
Derek

Thanks for sharing reference @dkuc. Its working fine now