@ttoss/appsync-api 0.3.1 → 0.4.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/dist/cli.js CHANGED
@@ -3638,6 +3638,9 @@ var require_findup_sync = __commonJS({
3638
3638
  // src/cli.ts
3639
3639
  var fs = __toESM(require("fs"));
3640
3640
 
3641
+ // src/createApiTemplate.ts
3642
+ var import_graphql_compose = require("graphql-compose");
3643
+
3641
3644
  // ../carlin/src/utils/packageJson.ts
3642
3645
  var import_findup_sync = __toESM(require_findup_sync());
3643
3646
 
@@ -3651,6 +3654,7 @@ var argv = (0, import_minimist.default)(process.argv.slice(2));
3651
3654
  if (argv._.includes("build-schema")) {
3652
3655
  const template = (0, import_cloudformation.findAndReadCloudFormationTemplate)({});
3653
3656
  const sdl = template.Resources[AppSyncGraphQLSchemaLogicalId].Properties.Definition;
3657
+ console.log(sdl);
3654
3658
  fs.mkdirSync("schema", { recursive: true });
3655
3659
  fs.writeFileSync("schema/schema.graphql", sdl);
3656
3660
  }
@@ -4081,6 +4081,9 @@ var require_findup_sync = __commonJS({
4081
4081
  }
4082
4082
  });
4083
4083
 
4084
+ // src/createApiTemplate.ts
4085
+ import { graphql } from "graphql-compose";
4086
+
4084
4087
  // ../../node_modules/tslib/modules/index.js
4085
4088
  var import_tslib = __toESM(require_tslib(), 1);
4086
4089
  var {
@@ -4184,7 +4187,7 @@ var readPackageJson = () => {
4184
4187
  // package.json
4185
4188
  var package_default = {
4186
4189
  name: "@ttoss/appsync-api",
4187
- version: "0.3.1",
4190
+ version: "0.4.0",
4188
4191
  description: "",
4189
4192
  license: "UNLICENSED",
4190
4193
  author: "ttoss",
@@ -4233,6 +4236,7 @@ var createApiTemplate = ({
4233
4236
  schemaComposer
4234
4237
  }) => {
4235
4238
  const sdl = schemaComposer.toSDL();
4239
+ graphql.validateSchema(schemaComposer.buildSchema());
4236
4240
  const resolveMethods = schemaComposer.getResolveMethods();
4237
4241
  const resolveMethodsEntries = Object.entries(resolveMethods).flatMap(
4238
4242
  ([typeName, fieldResolvers]) => {
package/dist/esm/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import {
3
3
  AppSyncGraphQLSchemaLogicalId
4
- } from "./chunk-ZDHV6GQI.js";
4
+ } from "./chunk-AZQ4OFLJ.js";
5
5
 
6
6
  // src/cli.ts
7
7
  import * as fs from "fs";
@@ -11,6 +11,7 @@ var argv = minimist(process.argv.slice(2));
11
11
  if (argv._.includes("build-schema")) {
12
12
  const template = findAndReadCloudFormationTemplate({});
13
13
  const sdl = template.Resources[AppSyncGraphQLSchemaLogicalId].Properties.Definition;
14
+ console.log(sdl);
14
15
  fs.mkdirSync("schema", { recursive: true });
15
16
  fs.writeFileSync("schema/schema.graphql", sdl);
16
17
  }
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
2
2
  import {
3
3
  createApiTemplate
4
- } from "./chunk-ZDHV6GQI.js";
4
+ } from "./chunk-AZQ4OFLJ.js";
5
5
 
6
6
  // src/index.ts
7
7
  import { schemaComposer } from "graphql-compose";
package/dist/index.js CHANGED
@@ -4085,9 +4085,12 @@ var src_exports = {};
4085
4085
  __export(src_exports, {
4086
4086
  appSyncResolverHandler: () => appSyncResolverHandler,
4087
4087
  createApiTemplate: () => createApiTemplate,
4088
- schemaComposer: () => import_graphql_compose.schemaComposer
4088
+ schemaComposer: () => import_graphql_compose2.schemaComposer
4089
4089
  });
4090
4090
  module.exports = __toCommonJS(src_exports);
4091
+ var import_graphql_compose2 = require("graphql-compose");
4092
+
4093
+ // src/createApiTemplate.ts
4091
4094
  var import_graphql_compose = require("graphql-compose");
4092
4095
 
4093
4096
  // ../../node_modules/tslib/modules/index.js
@@ -4193,7 +4196,7 @@ var readPackageJson = () => {
4193
4196
  // package.json
4194
4197
  var package_default = {
4195
4198
  name: "@ttoss/appsync-api",
4196
- version: "0.3.1",
4199
+ version: "0.4.0",
4197
4200
  description: "",
4198
4201
  license: "UNLICENSED",
4199
4202
  author: "ttoss",
@@ -4242,6 +4245,7 @@ var createApiTemplate = ({
4242
4245
  schemaComposer: schemaComposer2
4243
4246
  }) => {
4244
4247
  const sdl = schemaComposer2.toSDL();
4248
+ import_graphql_compose.graphql.validateSchema(schemaComposer2.buildSchema());
4245
4249
  const resolveMethods = schemaComposer2.getResolveMethods();
4246
4250
  const resolveMethodsEntries = Object.entries(resolveMethods).flatMap(
4247
4251
  ([typeName, fieldResolvers]) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/appsync-api",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "license": "UNLICENSED",
6
6
  "author": "ttoss",
@@ -36,5 +36,5 @@
36
36
  "publishConfig": {
37
37
  "access": "public"
38
38
  },
39
- "gitHead": "a5396840d88867e223247b3fc87188a174c147c7"
39
+ "gitHead": "ce54241307f6953a4e3b34ce7e24d71aadf12dca"
40
40
  }
package/src/cli.ts CHANGED
@@ -11,6 +11,9 @@ if (argv._.includes('build-schema')) {
11
11
  const sdl =
12
12
  template.Resources[AppSyncGraphQLSchemaLogicalId].Properties.Definition;
13
13
 
14
+ // eslint-disable-next-line no-console
15
+ console.log(sdl);
16
+
14
17
  /**
15
18
  * Save to schema/schema.graphql. schema folder might not exist.
16
19
  */
@@ -1,8 +1,8 @@
1
+ import { type SchemaComposer, graphql } from 'graphql-compose';
1
2
  import { getPackageLambdaLayerStackName } from 'carlin/src/deploy/lambdaLayer/getPackageLambdaLayerStackName';
2
3
  import { readPackageJson } from 'carlin/src/utils/packageJson';
3
4
  import packageJson from '../package.json';
4
5
  import type { CloudFormationTemplate } from 'carlin/src/utils/cloudFormationTemplate';
5
- import type { SchemaComposer } from 'graphql-compose';
6
6
 
7
7
  const AppSyncGraphQLApiLogicalId = 'AppSyncGraphQLApi';
8
8
 
@@ -29,6 +29,8 @@ export const createApiTemplate = ({
29
29
  */
30
30
  const sdl = schemaComposer.toSDL();
31
31
 
32
+ graphql.validateSchema(schemaComposer.buildSchema());
33
+
32
34
  /**
33
35
  * Get FieldName and TypeName. `resolveMethods` is a Map of
34
36
  * `typeName: { fieldName: resolverFn }`