mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-18 04:51:35 +03:00
38 lines
920 B
JavaScript
38 lines
920 B
JavaScript
const {query} = require('graphqurl');
|
|
|
|
const complexQuery = `
|
|
query {
|
|
favoriteRoutes {
|
|
routeByRoutesId {
|
|
leagueByLeaguesId {
|
|
flightsByLeaguesId {
|
|
flightCommentsByFlightsId {
|
|
userByUsersId {
|
|
email
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`;
|
|
|
|
const verifyDataImport = () => {
|
|
query({
|
|
query: complexQuery,
|
|
endpoint: `${process.env.TEST_HGE_URL}/v1alpha1/graphql`,
|
|
headers: {'x-hasura-access-key': process.env.TEST_X_HASURA_ACCESS_KEY},
|
|
}).then(response => {
|
|
if (response.data.favoriteRoutes[0].routeByRoutesId.leagueByLeaguesId.flightsByLeaguesId[0].flightCommentsByFlightsId[0].userByUsersId.email === 'osxcode@gmail.com') {
|
|
console.log('✔︎ Test passed');
|
|
process.exit();
|
|
} else {
|
|
console.log('✖ Test failed. Unexpected response.');
|
|
console.log(response.data);
|
|
}
|
|
});
|
|
};
|
|
|
|
verifyDataImport();
|