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

Function TestHandleExecuteGraphQL_EmptyQuery

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

Source from the content-addressed store, hash-verified

156}
157
158func TestHandleExecuteGraphQL_EmptyQuery(t *testing.T) {
159 ms := mockMcpServerWithConfig(MCPConfig{
160 AllowRawQueries: true,
161 AllowMutations: true,
162 })
163 ctx := context.Background()
164
165 req := newToolRequest(map[string]any{
166 "query": "",
167 })
168
169 result, err := ms.handleExecuteGraphQL(ctx, req)
170 if err != nil {
171 t.Fatalf("Unexpected error: %v", err)
172 }
173
174 assertToolError(t, result, "query is required")
175}
176
177func TestHandleExecuteGraphQL_MutationBlocked(t *testing.T) {
178 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