wgc 0.8.2 → 0.9.0
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.
- package/CHANGELOG.md +12 -0
- package/dist/commands/federated-graph/index.js +4 -6
- package/dist/commands/federated-graph/index.js.map +1 -1
- package/dist/commands/index.js +5 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/router/commands/compose.js +62 -0
- package/dist/commands/router/commands/compose.js.map +1 -0
- package/dist/commands/router/commands/fetch.d.ts +4 -0
- package/dist/commands/{federated-graph/commands/fetch-config.js → router/commands/fetch.js} +2 -2
- package/dist/commands/router/commands/fetch.js.map +1 -0
- package/dist/commands/router/index.d.ts +4 -0
- package/dist/commands/router/index.js +11 -0
- package/dist/commands/router/index.js.map +1 -0
- package/dist/commands/subgraph/commands/introspect.d.ts +4 -0
- package/dist/commands/subgraph/commands/introspect.js +32 -0
- package/dist/commands/subgraph/commands/introspect.js.map +1 -0
- package/dist/commands/subgraph/index.js +2 -0
- package/dist/commands/subgraph/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils.d.ts +17 -0
- package/dist/utils.js +43 -0
- package/dist/utils.js.map +1 -0
- package/package.json +9 -5
- package/src/commands/federated-graph/index.ts +4 -6
- package/src/commands/index.ts +7 -1
- package/src/commands/router/commands/compose.ts +98 -0
- package/src/commands/{federated-graph/commands/fetch-config.ts → router/commands/fetch.ts} +1 -1
- package/src/commands/router/index.ts +12 -0
- package/src/commands/subgraph/commands/introspect.ts +40 -0
- package/src/commands/subgraph/index.ts +2 -0
- package/src/utils.ts +57 -0
- package/dist/commands/federated-graph/commands/fetch-config.js.map +0 -1
- /package/dist/commands/{federated-graph/commands/fetch-config.d.ts → router/commands/compose.d.ts} +0 -0
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FederationResultContainer, Subgraph } from '@wundergraph/composition';
|
|
2
|
+
export interface Header {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const introspectSubgraph: ({ subgraphURL, additionalHeaders, }: {
|
|
7
|
+
subgraphURL: string;
|
|
8
|
+
additionalHeaders: Header[];
|
|
9
|
+
}) => Promise<{
|
|
10
|
+
sdl: string;
|
|
11
|
+
errorMessage?: string;
|
|
12
|
+
success: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* Composes a list of subgraphs into a single schema.
|
|
16
|
+
*/
|
|
17
|
+
export declare function composeSubgraphs(subgraphs: Subgraph[]): FederationResultContainer;
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { federateSubgraphs } from '@wundergraph/composition';
|
|
2
|
+
export const introspectSubgraph = async ({ subgraphURL, additionalHeaders, }) => {
|
|
3
|
+
const headers = new Headers();
|
|
4
|
+
headers.append('Content-Type', 'application/json');
|
|
5
|
+
for (const header of additionalHeaders) {
|
|
6
|
+
headers.append(header.key, header.value);
|
|
7
|
+
}
|
|
8
|
+
const graphql = JSON.stringify({
|
|
9
|
+
query: `
|
|
10
|
+
{
|
|
11
|
+
_service{
|
|
12
|
+
sdl
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
`,
|
|
16
|
+
variables: {},
|
|
17
|
+
});
|
|
18
|
+
const response = await fetch(subgraphURL, {
|
|
19
|
+
method: 'POST',
|
|
20
|
+
headers,
|
|
21
|
+
body: graphql,
|
|
22
|
+
});
|
|
23
|
+
if (response.status !== 200) {
|
|
24
|
+
return {
|
|
25
|
+
success: false,
|
|
26
|
+
errorMessage: 'Could not introspect the subgraph.',
|
|
27
|
+
sdl: '',
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
const body = await response.json();
|
|
31
|
+
const data = body.data;
|
|
32
|
+
return {
|
|
33
|
+
success: true,
|
|
34
|
+
sdl: data._service.sdl,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Composes a list of subgraphs into a single schema.
|
|
39
|
+
*/
|
|
40
|
+
export function composeSubgraphs(subgraphs) {
|
|
41
|
+
return federateSubgraphs(subgraphs);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuC,MAAM,0BAA0B,CAAC;AAOlG,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,EAAE,EACvC,WAAW,EACX,iBAAiB,GAIlB,EAAqE,EAAE;IACtE,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;IACnD,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE;QACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;KAC1C;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;QAC7B,KAAK,EAAE;;;;;;OAMJ;QACH,SAAS,EAAE,EAAE;KACd,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,EAAE;QACxC,MAAM,EAAE,MAAM;QACd,OAAO;QACP,IAAI,EAAE,OAAO;KACd,CAAC,CAAC;IACH,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;QAC3B,OAAO;YACL,OAAO,EAAE,KAAK;YACd,YAAY,EAAE,oCAAoC;YAClD,GAAG,EAAE,EAAE;SACR,CAAC;KACH;IACD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACvB,OAAO;QACL,OAAO,EAAE,IAAI;QACb,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG;KACvB,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAqB;IACpD,OAAO,iBAAiB,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wgc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "The official CLI tool to manage the GraphQL Federation Platform Cosmo",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,11 +32,14 @@
|
|
|
32
32
|
"@bufbuild/buf": "^1.26.1",
|
|
33
33
|
"@connectrpc/connect": "^0.13.2",
|
|
34
34
|
"@connectrpc/connect-node": "^0.13.2",
|
|
35
|
-
"@wundergraph/
|
|
36
|
-
"@wundergraph/cosmo-
|
|
35
|
+
"@wundergraph/composition": "0.6.1",
|
|
36
|
+
"@wundergraph/cosmo-connect": "0.9.0",
|
|
37
|
+
"@wundergraph/cosmo-shared": "0.6.4",
|
|
37
38
|
"cli-table": "^0.3.11",
|
|
38
39
|
"commander": "^11.0.0",
|
|
40
|
+
"graphql": "^16.7.1",
|
|
39
41
|
"inquirer": "^9.2.7",
|
|
42
|
+
"js-yaml": "^4.1.0",
|
|
40
43
|
"log-symbols": "^5.1.0",
|
|
41
44
|
"pathe": "^1.1.1",
|
|
42
45
|
"picocolors": "^1.0.0"
|
|
@@ -44,6 +47,7 @@
|
|
|
44
47
|
"devDependencies": {
|
|
45
48
|
"@types/cli-table": "^0.3.1",
|
|
46
49
|
"@types/inquirer": "^9.0.3",
|
|
50
|
+
"@types/js-yaml": "^4.0.5",
|
|
47
51
|
"@types/node": "^20.3.1",
|
|
48
52
|
"del-cli": "^5.0.0",
|
|
49
53
|
"eslint": "^8.44.0",
|
|
@@ -53,5 +57,5 @@
|
|
|
53
57
|
"typescript": "^5.1.3",
|
|
54
58
|
"vitest": "^0.34.1"
|
|
55
59
|
},
|
|
56
|
-
"gitHead": "
|
|
57
|
-
}
|
|
60
|
+
"gitHead": "665a7bd20e06164aa2ae2dd79003547cec96f731"
|
|
61
|
+
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { BaseCommandOptions } from '../../core/types/types.js';
|
|
3
|
-
import CreateFederatedGraphCommand from './commands/create.js';
|
|
4
|
-
import FetchFederatedGraphCommand from './commands/fetch.js';
|
|
5
|
-
import DeleteFederatedGraphCommand from './commands/delete.js';
|
|
6
|
-
import UpdateFederatedGraphCommand from './commands/update.js';
|
|
7
3
|
import CheckFederatedGraphCommand from './commands/check.js';
|
|
8
4
|
import CreateFederatedGraphToken from './commands/create-token.js';
|
|
9
|
-
import
|
|
5
|
+
import CreateFederatedGraphCommand from './commands/create.js';
|
|
6
|
+
import DeleteFederatedGraphCommand from './commands/delete.js';
|
|
7
|
+
import FetchFederatedGraphCommand from './commands/fetch.js';
|
|
10
8
|
import ListFederatedGraphs from './commands/list.js';
|
|
9
|
+
import UpdateFederatedGraphCommand from './commands/update.js';
|
|
11
10
|
|
|
12
11
|
export default (opts: BaseCommandOptions) => {
|
|
13
12
|
const schema = new Command('federated-graph');
|
|
@@ -18,7 +17,6 @@ export default (opts: BaseCommandOptions) => {
|
|
|
18
17
|
schema.addCommand(UpdateFederatedGraphCommand(opts));
|
|
19
18
|
schema.addCommand(CheckFederatedGraphCommand(opts));
|
|
20
19
|
schema.addCommand(CreateFederatedGraphToken(opts));
|
|
21
|
-
schema.addCommand(FetchRouterConfig(opts));
|
|
22
20
|
schema.addCommand(ListFederatedGraphs(opts));
|
|
23
21
|
return schema;
|
|
24
22
|
};
|
package/src/commands/index.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { Command } from 'commander';
|
|
|
2
2
|
import pc from 'picocolors';
|
|
3
3
|
import { CreateClient } from '../core/client/client.js';
|
|
4
4
|
import { config } from '../core/config.js';
|
|
5
|
-
import SchemaCommands from './subgraph/index.js';
|
|
6
5
|
import AuthCommands from './auth/index.js';
|
|
7
6
|
import FederatedGraphCommands from './federated-graph/index.js';
|
|
7
|
+
import RouterCommands from './router/index.js';
|
|
8
|
+
import SchemaCommands from './subgraph/index.js';
|
|
8
9
|
|
|
9
10
|
if (!config.apiKey) {
|
|
10
11
|
console.log(
|
|
@@ -43,5 +44,10 @@ program.addCommand(
|
|
|
43
44
|
client,
|
|
44
45
|
}),
|
|
45
46
|
);
|
|
47
|
+
program.addCommand(
|
|
48
|
+
RouterCommands({
|
|
49
|
+
client,
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
46
52
|
|
|
47
53
|
export default program;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { readFile } from 'node:fs/promises';
|
|
3
|
+
import { buildRouterConfig } from '@wundergraph/cosmo-shared';
|
|
4
|
+
import { Command, program } from 'commander';
|
|
5
|
+
import { parse, printSchema } from 'graphql';
|
|
6
|
+
import * as yaml from 'js-yaml';
|
|
7
|
+
import { resolve } from 'pathe';
|
|
8
|
+
import pc from 'picocolors';
|
|
9
|
+
import { BaseCommandOptions } from '../../../core/types/types.js';
|
|
10
|
+
import { composeSubgraphs, introspectSubgraph } from '../../../utils.js';
|
|
11
|
+
|
|
12
|
+
type Subgraph = {
|
|
13
|
+
name: string;
|
|
14
|
+
url: string;
|
|
15
|
+
headers?: {
|
|
16
|
+
[key: string]: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
type Graph = {
|
|
21
|
+
name: string;
|
|
22
|
+
router: {
|
|
23
|
+
url: string;
|
|
24
|
+
};
|
|
25
|
+
subgraphs: Subgraph[];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type Config = {
|
|
29
|
+
version: number;
|
|
30
|
+
graphs: Graph[];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default (opts: BaseCommandOptions) => {
|
|
34
|
+
const command = new Command('compose');
|
|
35
|
+
command.description('Generates the router config locally. The output can be piped to a file.');
|
|
36
|
+
command.requiredOption('-i, --input <path-to-input>', 'The yaml file with data about graph and subgraphs.');
|
|
37
|
+
command.action(async (options) => {
|
|
38
|
+
const inputFile = resolve(process.cwd(), options.input);
|
|
39
|
+
|
|
40
|
+
if (!existsSync(inputFile)) {
|
|
41
|
+
console.log(
|
|
42
|
+
pc.red(pc.bold(`The input file '${pc.bold(inputFile)}' does not exist. Please check the path and try again.`)),
|
|
43
|
+
);
|
|
44
|
+
process.exit(1);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const fileContent = (await readFile(inputFile)).toString();
|
|
48
|
+
const config = yaml.load(fileContent) as Config;
|
|
49
|
+
|
|
50
|
+
const promises = [];
|
|
51
|
+
for (const s of config.graphs[0].subgraphs) {
|
|
52
|
+
const promise = introspectSubgraph({
|
|
53
|
+
subgraphURL: s.url,
|
|
54
|
+
additionalHeaders: Object.entries(s.headers ?? {}).map(([key, value]) => ({
|
|
55
|
+
key,
|
|
56
|
+
value,
|
|
57
|
+
})),
|
|
58
|
+
});
|
|
59
|
+
promises.push(promise);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const introspectResults = await Promise.all(promises);
|
|
63
|
+
|
|
64
|
+
if (introspectResults.some((r) => !r.success)) {
|
|
65
|
+
program.error('Could not introspect one or more subgraphs');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const result = composeSubgraphs(
|
|
69
|
+
config.graphs[0].subgraphs.map((s, index) => ({
|
|
70
|
+
name: s.name,
|
|
71
|
+
url: s.url,
|
|
72
|
+
definitions: parse(introspectResults[index].sdl),
|
|
73
|
+
})),
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
if (result.errors && result.errors.length > 0) {
|
|
77
|
+
program.error(`Failed to compose: ${result.errors[0]}`);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (!result.federationResult) {
|
|
81
|
+
program.error('Failed to compose given subgraphs');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const routerConfig = buildRouterConfig({
|
|
85
|
+
argumentConfigurations: result.federationResult.argumentConfigurations,
|
|
86
|
+
federatedSDL: printSchema(result.federationResult.federatedGraphSchema),
|
|
87
|
+
subgraphs: config.graphs[0].subgraphs.map((s, index) => ({
|
|
88
|
+
name: s.name,
|
|
89
|
+
url: s.url,
|
|
90
|
+
sdl: introspectResults[index].sdl,
|
|
91
|
+
})),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
console.log(routerConfig.toJsonString());
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
return command;
|
|
98
|
+
};
|
|
@@ -5,7 +5,7 @@ import { baseHeaders } from '../../../core/config.js';
|
|
|
5
5
|
import { BaseCommandOptions } from '../../../core/types/types.js';
|
|
6
6
|
|
|
7
7
|
export default (opts: BaseCommandOptions) => {
|
|
8
|
-
const command = new Command('fetch
|
|
8
|
+
const command = new Command('fetch');
|
|
9
9
|
command.description(
|
|
10
10
|
'Fetches the latest valid router config for a federated graph. The output can be piped to a file.',
|
|
11
11
|
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { BaseCommandOptions } from '../../core/types/types.js';
|
|
3
|
+
import ComposeRouterConfig from './commands/compose.js';
|
|
4
|
+
import FetchRouterConfig from './commands/fetch.js';
|
|
5
|
+
|
|
6
|
+
export default (opts: BaseCommandOptions) => {
|
|
7
|
+
const cmd = new Command('router');
|
|
8
|
+
cmd.description('Provides commands for fetching and composing router configs');
|
|
9
|
+
cmd.addCommand(FetchRouterConfig(opts));
|
|
10
|
+
cmd.addCommand(ComposeRouterConfig(opts));
|
|
11
|
+
return cmd;
|
|
12
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { splitLabel } from '@wundergraph/cosmo-shared';
|
|
2
|
+
import { Command } from 'commander';
|
|
3
|
+
import pc from 'picocolors';
|
|
4
|
+
import { BaseCommandOptions } from '../../../core/types/types.js';
|
|
5
|
+
import { introspectSubgraph } from '../../../utils.js';
|
|
6
|
+
import program from '../../index.js';
|
|
7
|
+
|
|
8
|
+
export default (opts: BaseCommandOptions) => {
|
|
9
|
+
const introspectSubgraphCmd = new Command('introspect');
|
|
10
|
+
introspectSubgraphCmd.description('Introspects a subgraph.');
|
|
11
|
+
introspectSubgraphCmd.requiredOption(
|
|
12
|
+
'-r, --routing-url <url>',
|
|
13
|
+
'The routing url of your subgraph. This is the url that the subgraph will be accessible at.',
|
|
14
|
+
);
|
|
15
|
+
introspectSubgraphCmd.option(
|
|
16
|
+
'--header [headers...]',
|
|
17
|
+
'The headers to apply when the subgraph is introspected. This is used for authentication and authorization.The headers are passed in the format <key>=<value> <key>=<value>.Use quotes if there exists space in the key/value.',
|
|
18
|
+
);
|
|
19
|
+
introspectSubgraphCmd.action(async (options) => {
|
|
20
|
+
const resp = await introspectSubgraph({
|
|
21
|
+
subgraphURL: options.routingUrl,
|
|
22
|
+
additionalHeaders:
|
|
23
|
+
options.header?.map((label: string) => {
|
|
24
|
+
const { key, value } = splitLabel(label);
|
|
25
|
+
return {
|
|
26
|
+
key,
|
|
27
|
+
value,
|
|
28
|
+
};
|
|
29
|
+
}) || [],
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (resp.success === true) {
|
|
33
|
+
console.log(resp.sdl);
|
|
34
|
+
} else {
|
|
35
|
+
program.error(pc.red('Could not introspect the subgraph.'));
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return introspectSubgraphCmd;
|
|
40
|
+
};
|
|
@@ -7,6 +7,7 @@ import DeleteSubgraph from './commands/delete.js';
|
|
|
7
7
|
import UpdateSubgraph from './commands/update.js';
|
|
8
8
|
import FixSubGraph from './commands/fix.js';
|
|
9
9
|
import ListSubgraphs from './commands/list.js';
|
|
10
|
+
import IntrospectSubgraph from './commands/introspect.js';
|
|
10
11
|
|
|
11
12
|
export default (opts: BaseCommandOptions) => {
|
|
12
13
|
const schema = new Command('subgraph');
|
|
@@ -18,5 +19,6 @@ export default (opts: BaseCommandOptions) => {
|
|
|
18
19
|
schema.addCommand(UpdateSubgraph(opts));
|
|
19
20
|
schema.addCommand(FixSubGraph(opts));
|
|
20
21
|
schema.addCommand(ListSubgraphs(opts));
|
|
22
|
+
schema.addCommand(IntrospectSubgraph(opts));
|
|
21
23
|
return schema;
|
|
22
24
|
};
|
package/src/utils.ts
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { federateSubgraphs, FederationResultContainer, Subgraph } from '@wundergraph/composition';
|
|
2
|
+
|
|
3
|
+
export interface Header {
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const introspectSubgraph = async ({
|
|
9
|
+
subgraphURL,
|
|
10
|
+
additionalHeaders,
|
|
11
|
+
}: {
|
|
12
|
+
subgraphURL: string;
|
|
13
|
+
additionalHeaders: Header[];
|
|
14
|
+
}): Promise<{ sdl: string; errorMessage?: string; success: boolean }> => {
|
|
15
|
+
const headers = new Headers();
|
|
16
|
+
headers.append('Content-Type', 'application/json');
|
|
17
|
+
for (const header of additionalHeaders) {
|
|
18
|
+
headers.append(header.key, header.value);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const graphql = JSON.stringify({
|
|
22
|
+
query: `
|
|
23
|
+
{
|
|
24
|
+
_service{
|
|
25
|
+
sdl
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`,
|
|
29
|
+
variables: {},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const response = await fetch(subgraphURL, {
|
|
33
|
+
method: 'POST',
|
|
34
|
+
headers,
|
|
35
|
+
body: graphql,
|
|
36
|
+
});
|
|
37
|
+
if (response.status !== 200) {
|
|
38
|
+
return {
|
|
39
|
+
success: false,
|
|
40
|
+
errorMessage: 'Could not introspect the subgraph.',
|
|
41
|
+
sdl: '',
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const body = await response.json();
|
|
45
|
+
const data = body.data;
|
|
46
|
+
return {
|
|
47
|
+
success: true,
|
|
48
|
+
sdl: data._service.sdl,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Composes a list of subgraphs into a single schema.
|
|
54
|
+
*/
|
|
55
|
+
export function composeSubgraphs(subgraphs: Subgraph[]): FederationResultContainer {
|
|
56
|
+
return federateSubgraphs(subgraphs);
|
|
57
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-config.js","sourceRoot":"","sources":["../../../../src/commands/federated-graph/commands/fetch-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,eAAe,CAAC,IAAwB,EAAE,EAAE;IAC1C,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5C,OAAO,CAAC,WAAW,CACjB,kGAAkG,CACnG,CAAC;IACF,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,2CAA2C,CAAC,CAAC;IACxE,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;;QACrC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAChE;YACE,SAAS,EAAE,IAAI;SAChB,EACD;YACE,OAAO,EAAE,WAAW;SACrB,CACF,CAAC;QAEF,IAAI,CAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,IAAI,MAAK,cAAc,CAAC,EAAE,EAAE;YAC7C,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,yDAAyD,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACnG,IAAI,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,EAAE;gBAC1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,MAAA,IAAI,CAAC,QAAQ,0CAAE,OAAO,CAAC,CAAC,CAAC,CAAC;aACtD;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SACjB;QAED,OAAO,CAAC,GAAG,CAAC,MAAA,IAAI,CAAC,MAAM,0CAAE,YAAY,EAAE,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC"}
|
/package/dist/commands/{federated-graph/commands/fetch-config.d.ts → router/commands/compose.d.ts}
RENAMED
|
File without changes
|