MCPcopy
hub / github.com/dosco/graphjin / TestHandleFederationQuery_Entities

Function TestHandleFederationQuery_Entities

core/federation_dispatch_test.go:82–97  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

80// dropping the request — so a gateway operator sees the gap clearly
81// instead of a confusing empty response.
82func 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

Callers

nothing calls this directly

Calls 2

fedTestEngineFunction · 0.85
handleFederationQueryMethod · 0.80

Tested by

no test coverage detected