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

Function TestHandleExecuteGraphQL_MissingQuery

serv/mcp_test.go:139–156  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

137}
138
139func TestHandleExecuteGraphQL_MissingQuery(t *testing.T) {
140 ms := mockMcpServerWithConfig(MCPConfig{
141 AllowRawQueries: true,
142 AllowMutations: true,
143 })
144 ctx := context.Background()
145
146 req := newToolRequest(map[string]any{
147 // No query provided
148 })
149
150 result, err := ms.handleExecuteGraphQL(ctx, req)
151 if err != nil {
152 t.Fatalf("Unexpected error: %v", err)
153 }
154
155 assertToolError(t, result, "query is required")
156}
157
158func TestHandleExecuteGraphQL_EmptyQuery(t *testing.T) {
159 ms := mockMcpServerWithConfig(MCPConfig{

Callers

nothing calls this directly

Calls 4

mockMcpServerWithConfigFunction · 0.85
newToolRequestFunction · 0.85
assertToolErrorFunction · 0.85
handleExecuteGraphQLMethod · 0.80

Tested by

no test coverage detected