Modern QA2026Test 2: Entity References Resolve Across Subgraphs — tiles
Log inJoin
48 / 89 · 04 API & Contract Testing with AI · Schema Federation Testing← prev⊞ allnext →☰ Read as one page

8.4Test 2: Entity References Resolve Across Subgraphs

    def test_entity_references_resolve(self, gateway_client):
        """Entity references across subgraphs should resolve without errors."""
        # Product is defined in ProductService, but Order references it
        query = """
        query {
          order(id: "order-123") {
            id
            items {
              product {
                id
                name        # Resolved from ProductService
                price       # Resolved from ProductService
              }
              quantity
            }
          }
        }
        """
        response = gateway_client.execute(query)
        assert "errors" not in response, (
            f"Entity resolution failed: {response.get('errors')}"
        )
        assert response["data"]["order"]["items"][0]["product"]["name"] is not None