mirror of
https://github.com/graphql-hive/console
synced 2026-04-21 14:37:17 +00:00
24 lines
764 B
TypeScript
24 lines
764 B
TypeScript
import * as utils from '@n1ru4l/dockest/test-helper';
|
|
import { execa } from '@n1ru4l/dockest';
|
|
import { resolve } from 'path';
|
|
|
|
const registryAddress = utils.getServiceAddress('server', 3001);
|
|
const cliDevLocation = resolve(__dirname, '../../packages/libraries/cli/bin/dev');
|
|
|
|
async function exec(cmd: string) {
|
|
const result = execa(`${cliDevLocation} ${cmd}`);
|
|
|
|
if (result.failed) {
|
|
throw result.stderr;
|
|
}
|
|
|
|
return result.stdout;
|
|
}
|
|
|
|
export async function schemaPublish(args: string[]) {
|
|
return exec(['schema:publish', `--registry`, `http://${registryAddress}/graphql`, ...args].join(' '));
|
|
}
|
|
|
|
export async function schemaCheck(args: string[]) {
|
|
return exec(['schema:check', `--registry`, `http://${registryAddress}/graphql`, ...args].join(' '));
|
|
}
|