TestHandleFederationQuery_Entities verifies that `_entities` queries return the documented "not yet implemented" error rather than silently dropping the request — so a gateway operator sees the gap clearly instead of a confusing empty response.
(t *testing.T)
| 80 | // dropping the request — so a gateway operator sees the gap clearly |
| 81 | // instead of a confusing empty response. |
| 82 | func TestHandleFederationQuery_Entities(t *testing.T) { |
| 83 | gj := fedTestEngine(t) |
| 84 | |
| 85 | handled, data, err := gj.handleFederationQuery(GraphqlReq{ |
| 86 | query: []byte(`query Q($r: [_Any!]!) { _entities(representations: $r) { __typename } }`), |
| 87 | }) |
| 88 | if !handled { |
| 89 | t.Fatalf("expected handled=true for _entities query") |
| 90 | } |
| 91 | if !errors.Is(err, errFederationEntitiesNotImplemented) { |
| 92 | t.Errorf("expected errFederationEntitiesNotImplemented, got %v", err) |
| 93 | } |
| 94 | if data != nil { |
| 95 | t.Errorf("expected nil data for unimplemented path, got %s", data) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | // TestHandleFederationQuery_PassthroughForRegularQuery confirms that |
| 100 | // non-federation queries flow through the normal compile path |
nothing calls this directly
no test coverage detected