lrj
3 天以前 c61d4fe27c97d2ecc907756aa571a4ef14a7b9b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
 
$headers = @{
    "Content-Type" = "application/json"
}
 
Write-Host "=== Test Without State Filter ==="
 
# Test: Create a simple query without state filtering
Write-Host "1. Testing GraphQL introspection..."
$body1 = @{
    query = 'query { __schema { queryType { name } } }'
} | ConvertTo-Json
 
$response1 = Invoke-RestMethod -Uri "http://localhost:8080/api/graphql" -Method POST -Body $body1 -Headers $headers
Write-Host "Introspection result:"
$response1 | ConvertTo-Json -Depth 10
 
Write-Host "`n2. Testing simple mutation (should work)..."
$body2 = @{
    query = 'mutation { 
        saveActivity(input: { 
            name: "Simple Test", 
            description: "Simple test without stages", 
            signupDeadline: "2024-12-31T23:59:59", 
            ratingSchemeId: 1, 
            pid: 0
        }) { 
            id name 
        } 
    }'
} | ConvertTo-Json
 
$response2 = Invoke-RestMethod -Uri "http://localhost:8080/api/graphql" -Method POST -Body $body2 -Headers $headers
Write-Host "Simple mutation result:"
$response2 | ConvertTo-Json -Depth 10