0

In Apollo Federation 2 :

Consider the following two services that both own an entity of the same name called Product :

Products service :

  type Product @key(fields: "id")  {
    id: Int!
    productname: String!
  }

Inventory service :

  type Product @key(fields: "id")  {
    id: Int!
    qty: Int!
  }

The team that owns Products service has no way of modifying the Inventory service, and vice versa. The team that owns Products service has no idea what fields are in Inventory service (or that Inventory service even exists) and vice versa.

In this case, does Apollo Federation support a way for the supergraph to query across Federated services without using key field or shared fields? In the above example, what if I want to query an aggregate of Products where :

productname = "My product" AND qty < 1000 AND qty > 500 ?

If the Product team has no idea what fields Inventory service owns and vice versa, how can we federate input types and queries such that we can take full advantage of all the fields across all the subgraphs? Is this possible?

John Kim
  • 1,081
  • 10
  • 26

0 Answers0