const axios = require('axios');
|
|
const GRAPHQL_URL = 'http://localhost:8080/api/graphql';
|
|
async function testActivityStages() {
|
try {
|
console.log('🔍 查询活动55的阶段信息...');
|
|
const query = `
|
query {
|
activity(id: "55") {
|
id
|
name
|
description
|
pid
|
path
|
stages {
|
id
|
name
|
description
|
pid
|
path
|
}
|
}
|
}
|
`;
|
|
const response = await axios.post(GRAPHQL_URL, {
|
query: query
|
}, {
|
headers: {
|
'Content-Type': 'application/json'
|
}
|
});
|
|
if (response.data.errors) {
|
console.error('❌ GraphQL错误:', response.data.errors);
|
return;
|
}
|
|
console.log('✅ 查询成功!');
|
console.log('活动55信息:', JSON.stringify(response.data.data.activities, null, 2));
|
|
} catch (error) {
|
console.error('❌ 请求失败:', error.message);
|
if (error.response) {
|
console.error('响应状态:', error.response.status);
|
console.error('响应数据:', error.response.data);
|
}
|
}
|
}
|
|
testActivityStages();
|