mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
bb63d7e60e
Co-authored-by: Rishichandra Wawhal <rishichandra.wawhal@gmail.com> Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com> Co-authored-by: Aravind <aravindkp@outlook.in> Co-authored-by: Anon Ray <ecthiender@users.noreply.github.com> Co-authored-by: Shahidh K Muhammed <muhammedshahid.k@gmail.com>
36 lines
884 B
JavaScript
36 lines
884 B
JavaScript
const { toPayload, fromPayload } = require('./payload');
|
|
|
|
const { handlePayload: toHandler } = require('../../build/services/sdl/to/handler');
|
|
const { handlePayload: fromHandler } = require('../../build/services/sdl/from/handler');
|
|
|
|
const test = async () => {
|
|
|
|
const toResponse = toHandler(toPayload);
|
|
|
|
if (
|
|
toResponse.status === 200
|
|
) {
|
|
console.log('✓ Conversion from metadata to SDL passed');
|
|
} else {
|
|
console.log('✘ Conversion from metadata to SDL failed');
|
|
console.log(toResponse);
|
|
process.exit(1);
|
|
}
|
|
|
|
const fromResponse = fromHandler(fromPayload);
|
|
if (
|
|
fromResponse.status === 200
|
|
) {
|
|
console.log('✓ Conversion from SDL to metadata passed');
|
|
} else {
|
|
console.log('✘ Conversion from SDL to metadata failed');
|
|
console.log(fromResponse);
|
|
process.exit(1);
|
|
}
|
|
|
|
return Promise.resolve()
|
|
|
|
}
|
|
|
|
module.exports = test;
|