[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
|