lrj
2 天以前 c61d4fe27c97d2ecc907756aa571a4ef14a7b9b6
1
2
3
4
5
6
7
8
9
10
11
12
$headers = @{
    "Content-Type" = "application/json"
}
 
$body = @{
    query = 'mutation { saveActivity(input: { name: "Test Competition", description: "This is a test competition", signupDeadline: "2025-10-01T10:00:00", matchTime: "2025-10-15T14:00:00", address: "Test Address", ratingSchemeId: 1, playerMax: 100, stages: [{ name: "Preliminary", description: "Preliminary stage", matchTime: "2025-10-15T14:00:00", address: "Preliminary Address", playerMax: 50 }, { name: "Final", description: "Final stage", matchTime: "2025-10-16T14:00:00", address: "Final Address", playerMax: 20 }], judges: [{ judgeId: 1, judgeName: "Judge1", stageIds: [] }, { judgeId: 2, judgeName: "Judge2", stageIds: [] }] }) { id name description } }'
} | ConvertTo-Json
 
Write-Host "创建比赛测试..."
$response = Invoke-RestMethod -Uri "http://localhost:8080/api/graphql" -Method POST -Body $body -Headers $headers
Write-Host "响应结果:"
$response | ConvertTo-Json -Depth 10