@graphql-inspector/cli 3.4.13 → 3.4.14-alpha-20230418083830-8dbc2d31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const http_1 = require("http");
|
|
5
|
+
const graphql_yoga_1 = require("graphql-yoga");
|
|
4
6
|
const open_1 = tslib_1.__importDefault(require("open"));
|
|
5
7
|
const commands_1 = require("@graphql-inspector/commands");
|
|
6
8
|
const logger_1 = require("@graphql-inspector/logger");
|
|
7
|
-
const node_1 = require("@graphql-yoga/node");
|
|
8
9
|
const fake_js_1 = require("./fake.js");
|
|
9
10
|
exports.default = (0, commands_1.createCommand)(api => {
|
|
10
11
|
const { loaders } = api;
|
|
@@ -42,19 +43,19 @@ exports.default = (0, commands_1.createCommand)(api => {
|
|
|
42
43
|
const port = args.port;
|
|
43
44
|
try {
|
|
44
45
|
(0, fake_js_1.fake)(schema);
|
|
45
|
-
const
|
|
46
|
+
const yoga = (0, graphql_yoga_1.createYoga)({
|
|
46
47
|
schema,
|
|
47
|
-
port,
|
|
48
|
-
cors: true,
|
|
49
48
|
logging: false,
|
|
50
49
|
});
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
const server = (0, http_1.createServer)(yoga);
|
|
51
|
+
yield new Promise(resolve => server.listen(port, () => resolve()));
|
|
52
|
+
const url = `http://localhost:${port}/graphql`;
|
|
53
53
|
logger_1.Logger.success(`GraphQL API: ${url}`);
|
|
54
54
|
yield (0, open_1.default)(url);
|
|
55
55
|
const shutdown = () => {
|
|
56
|
-
server.
|
|
57
|
-
|
|
56
|
+
server.close(() => {
|
|
57
|
+
process.exit(0);
|
|
58
|
+
});
|
|
58
59
|
};
|
|
59
60
|
process.on('SIGINT', shutdown);
|
|
60
61
|
process.on('SIGTERM', shutdown);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
+
import { createServer } from 'http';
|
|
3
|
+
import { createYoga } from 'graphql-yoga';
|
|
2
4
|
import open from 'open';
|
|
3
5
|
import { createCommand, parseGlobalArgs, } from '@graphql-inspector/commands';
|
|
4
6
|
import { Logger } from '@graphql-inspector/logger';
|
|
5
|
-
import { createServer } from '@graphql-yoga/node';
|
|
6
7
|
import { fake } from './fake.js';
|
|
7
8
|
export default createCommand(api => {
|
|
8
9
|
const { loaders } = api;
|
|
@@ -40,19 +41,19 @@ export default createCommand(api => {
|
|
|
40
41
|
const port = args.port;
|
|
41
42
|
try {
|
|
42
43
|
fake(schema);
|
|
43
|
-
const
|
|
44
|
+
const yoga = createYoga({
|
|
44
45
|
schema,
|
|
45
|
-
port,
|
|
46
|
-
cors: true,
|
|
47
46
|
logging: false,
|
|
48
47
|
});
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const server = createServer(yoga);
|
|
49
|
+
yield new Promise(resolve => server.listen(port, () => resolve()));
|
|
50
|
+
const url = `http://localhost:${port}/graphql`;
|
|
51
51
|
Logger.success(`GraphQL API: ${url}`);
|
|
52
52
|
yield open(url);
|
|
53
53
|
const shutdown = () => {
|
|
54
|
-
server.
|
|
55
|
-
|
|
54
|
+
server.close(() => {
|
|
55
|
+
process.exit(0);
|
|
56
|
+
});
|
|
56
57
|
};
|
|
57
58
|
process.on('SIGINT', shutdown);
|
|
58
59
|
process.on('SIGTERM', shutdown);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-inspector/cli",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.14-alpha-20230418083830-8dbc2d31",
|
|
4
4
|
"description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"peerDependencies": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@graphql-inspector/introspect-command": "3.4.9",
|
|
23
23
|
"@graphql-inspector/json-loader": "3.4.3",
|
|
24
24
|
"@graphql-inspector/loaders": "3.4.5",
|
|
25
|
-
"@graphql-inspector/serve-command": "3.4.
|
|
25
|
+
"@graphql-inspector/serve-command": "3.4.7-alpha-20230418083830-8dbc2d31",
|
|
26
26
|
"@graphql-inspector/similar-command": "3.4.9",
|
|
27
27
|
"@graphql-inspector/url-loader": "3.4.3",
|
|
28
28
|
"@graphql-inspector/validate-command": "3.4.9"
|