wgc 0.44.0 → 0.44.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wgc",
3
- "version": "0.44.0",
3
+ "version": "0.44.2",
4
4
  "description": "The official CLI tool to manage the GraphQL Federation Platform Cosmo",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -33,9 +33,9 @@
33
33
  "@bufbuild/protobuf": "^1.4.1",
34
34
  "@connectrpc/connect": "^1.1.3",
35
35
  "@connectrpc/connect-node": "^1.1.3",
36
- "@wundergraph/composition": "0.18.4",
37
- "@wundergraph/cosmo-connect": "0.59.0",
38
- "@wundergraph/cosmo-shared": "0.20.14",
36
+ "@wundergraph/composition": "0.18.5",
37
+ "@wundergraph/cosmo-connect": "0.59.1",
38
+ "@wundergraph/cosmo-shared": "0.20.16",
39
39
  "boxen": "^7.1.1",
40
40
  "cli-progress": "^3.12.0",
41
41
  "cli-table3": "^0.6.3",
@@ -70,5 +70,5 @@
70
70
  "typescript": "^5.2.2",
71
71
  "vitest": "^0.34.1"
72
72
  },
73
- "gitHead": "c2fb5bd19dbf6d1db1e5ffd33fe465ddd50bd5cb"
73
+ "gitHead": "7ef74c61ea8185cc54791be56a9630e50360c057"
74
74
  }
@@ -30,11 +30,19 @@ export default (opts: BaseCommandOptions) => {
30
30
  );
31
31
  }
32
32
 
33
+ const schemaBuffer = await readFile(schemaFile);
34
+ const schema = new TextDecoder().decode(schemaBuffer);
35
+ if (schema.trim().length === 0) {
36
+ program.error(
37
+ pc.red(pc.bold(`The schema file '${pc.bold(schemaFile)}' is empty. Please provide a valid schema.`)),
38
+ );
39
+ }
40
+
33
41
  const resp = await opts.client.platform.fixSubgraphSchema(
34
42
  {
35
43
  subgraphName: name,
36
44
  namespace: options.namespace,
37
- schema: await readFile(schemaFile),
45
+ schema,
38
46
  },
39
47
  {
40
48
  headers: baseHeaders,
@@ -57,12 +57,20 @@ export default (opts: BaseCommandOptions) => {
57
57
  );
58
58
  }
59
59
 
60
+ const schemaBuffer = await readFile(schemaFile);
61
+ const schema = new TextDecoder().decode(schemaBuffer);
62
+ if (schema.trim().length === 0) {
63
+ program.error(
64
+ pc.red(pc.bold(`The schema file '${pc.bold(schemaFile)}' is empty. Please provide a valid schema.`)),
65
+ );
66
+ }
67
+
60
68
  const resp = await opts.client.platform.publishFederatedSubgraph(
61
69
  {
62
70
  name,
63
71
  namespace: options.namespace,
64
72
  // Publish schema only
65
- schema: await readFile(schemaFile),
73
+ schema,
66
74
  // Optional when subgraph does not exist yet
67
75
  routingUrl: options.routingUrl,
68
76
  headers: options.header,
@@ -0,0 +1,3 @@
1
+ type User {
2
+ id: String
3
+ }