@ttoss/appsync-api 0.8.0 → 0.8.1
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/esm/{chunk-Y27A2LBZ.js → chunk-RWRQSJ4M.js} +6 -2
- package/dist/esm/cli.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +72 -1
- package/dist/index.js +6 -2
- package/package.json +2 -2
- package/src/createApiTemplate.ts +12 -2
|
@@ -79,7 +79,7 @@ var getPackageLambdaLayerStackName = (packageName) => {
|
|
|
79
79
|
// package.json
|
|
80
80
|
var package_default = {
|
|
81
81
|
name: "@ttoss/appsync-api",
|
|
82
|
-
version: "0.8.
|
|
82
|
+
version: "0.8.1",
|
|
83
83
|
description: "A library for building GraphQL APIs for AWS AppSync.",
|
|
84
84
|
license: "UNLICENSED",
|
|
85
85
|
author: "ttoss",
|
|
@@ -164,7 +164,11 @@ var createApiTemplate = ({
|
|
|
164
164
|
lambdaFunction,
|
|
165
165
|
userPoolConfig
|
|
166
166
|
}) => {
|
|
167
|
-
const sdl = schemaComposer.toSDL(
|
|
167
|
+
const sdl = schemaComposer.toSDL({
|
|
168
|
+
commentDescriptions: false,
|
|
169
|
+
omitDescriptions: true,
|
|
170
|
+
omitScalars: true
|
|
171
|
+
});
|
|
168
172
|
graphql.validateSchema(schemaComposer.buildSchema());
|
|
169
173
|
const resolveMethods = schemaComposer.getResolveMethods();
|
|
170
174
|
const resolveMethodsEntries = Object.entries(resolveMethods).flatMap(
|
package/dist/esm/cli.js
CHANGED
package/dist/esm/index.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,80 @@
|
|
|
1
1
|
import { SchemaComposer, ObjectTypeComposer } from 'graphql-compose';
|
|
2
|
-
import { CloudFormationTemplate } from '@ttoss/cloudformation';
|
|
3
2
|
import { AppSyncResolverHandler as AppSyncResolverHandler$1 } from 'aws-lambda';
|
|
4
3
|
export { AppSyncIdentityCognito } from 'aws-lambda';
|
|
5
4
|
export { default as composeWithConnection } from 'graphql-compose-connection';
|
|
6
5
|
|
|
6
|
+
interface Parameter {
|
|
7
|
+
AllowedValues?: string[];
|
|
8
|
+
Default?: string | number;
|
|
9
|
+
Description?: string;
|
|
10
|
+
Type: string;
|
|
11
|
+
NoEcho?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type Parameters = {
|
|
14
|
+
[key: string]: Parameter;
|
|
15
|
+
};
|
|
16
|
+
interface Resource {
|
|
17
|
+
Type: string;
|
|
18
|
+
DeletionPolicy?: 'Delete' | 'Retain';
|
|
19
|
+
Description?: string;
|
|
20
|
+
DependsOn?: string[] | string;
|
|
21
|
+
Condition?: string;
|
|
22
|
+
Properties: any;
|
|
23
|
+
}
|
|
24
|
+
interface IAMRoleResource extends Resource {
|
|
25
|
+
Type: 'AWS::IAM::Role';
|
|
26
|
+
Properties: {
|
|
27
|
+
AssumeRolePolicyDocument: {
|
|
28
|
+
Version: '2012-10-17';
|
|
29
|
+
Statement: {
|
|
30
|
+
Effect: 'Allow' | 'Deny';
|
|
31
|
+
Action: string;
|
|
32
|
+
Principal: any;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
ManagedPolicyArns?: string[];
|
|
36
|
+
Path?: string;
|
|
37
|
+
Policies?: {
|
|
38
|
+
PolicyName: string;
|
|
39
|
+
PolicyDocument: {
|
|
40
|
+
Version: '2012-10-17';
|
|
41
|
+
Statement: {
|
|
42
|
+
Effect: 'Allow' | 'Deny';
|
|
43
|
+
Action: string | string[];
|
|
44
|
+
Resource: string | string[] | {
|
|
45
|
+
[key: string]: string;
|
|
46
|
+
} | {
|
|
47
|
+
[key: string]: string;
|
|
48
|
+
}[];
|
|
49
|
+
}[];
|
|
50
|
+
};
|
|
51
|
+
}[];
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
type Resources = {
|
|
55
|
+
[key: string]: IAMRoleResource | Resource;
|
|
56
|
+
};
|
|
57
|
+
type Output = {
|
|
58
|
+
Description?: string;
|
|
59
|
+
Value: string | any;
|
|
60
|
+
Export?: {
|
|
61
|
+
Name: string | any;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
type Outputs = {
|
|
65
|
+
[key: string]: Output;
|
|
66
|
+
};
|
|
67
|
+
type CloudFormationTemplate = {
|
|
68
|
+
AWSTemplateFormatVersion: '2010-09-09';
|
|
69
|
+
Description?: string;
|
|
70
|
+
Transform?: 'AWS::Serverless-2016-10-31';
|
|
71
|
+
Mappings?: any;
|
|
72
|
+
Conditions?: any;
|
|
73
|
+
Parameters?: Parameters;
|
|
74
|
+
Resources: Resources;
|
|
75
|
+
Outputs?: Outputs;
|
|
76
|
+
};
|
|
77
|
+
|
|
7
78
|
type StringOrImport = string | {
|
|
8
79
|
'Fn::ImportValue': string;
|
|
9
80
|
};
|
package/dist/index.js
CHANGED
|
@@ -119,7 +119,7 @@ var getPackageLambdaLayerStackName = (packageName) => {
|
|
|
119
119
|
// package.json
|
|
120
120
|
var package_default = {
|
|
121
121
|
name: "@ttoss/appsync-api",
|
|
122
|
-
version: "0.8.
|
|
122
|
+
version: "0.8.1",
|
|
123
123
|
description: "A library for building GraphQL APIs for AWS AppSync.",
|
|
124
124
|
license: "UNLICENSED",
|
|
125
125
|
author: "ttoss",
|
|
@@ -204,7 +204,11 @@ var createApiTemplate = ({
|
|
|
204
204
|
lambdaFunction,
|
|
205
205
|
userPoolConfig
|
|
206
206
|
}) => {
|
|
207
|
-
const sdl = schemaComposer2.toSDL(
|
|
207
|
+
const sdl = schemaComposer2.toSDL({
|
|
208
|
+
commentDescriptions: false,
|
|
209
|
+
omitDescriptions: true,
|
|
210
|
+
omitScalars: true
|
|
211
|
+
});
|
|
208
212
|
import_graphql_compose.graphql.validateSchema(schemaComposer2.buildSchema());
|
|
209
213
|
const resolveMethods = schemaComposer2.getResolveMethods();
|
|
210
214
|
const resolveMethodsEntries = Object.entries(resolveMethods).flatMap(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/appsync-api",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "A library for building GraphQL APIs for AWS AppSync.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
]
|
|
70
70
|
}
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "128418716cbc6dd7d4a41a6925b455b7e4784f9f"
|
|
73
73
|
}
|
package/src/createApiTemplate.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { type SchemaComposer, graphql } from 'graphql-compose';
|
|
2
2
|
import { getPackageLambdaLayerStackName } from 'carlin/src/deploy/lambdaLayer/getPackageLambdaLayerStackName';
|
|
3
3
|
import packageJson from '../package.json';
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Absolute path to avoid:
|
|
6
|
+
* The inferred type of 'template' cannot be named without a reference to
|
|
7
|
+
* '@ttoss/appsync-api/node_modules/@ttoss/cloudformation'. This is likely not
|
|
8
|
+
* portable. A type annotation is necessary.ts(2742)
|
|
9
|
+
*/
|
|
10
|
+
import type { CloudFormationTemplate } from '../../cloudformation/src';
|
|
5
11
|
|
|
6
12
|
export const AppSyncGraphQLApiLogicalId = 'AppSyncGraphQLApi';
|
|
7
13
|
|
|
@@ -53,7 +59,11 @@ export const createApiTemplate = ({
|
|
|
53
59
|
* It should be on top of the file, otherwise it will have empty Mutation
|
|
54
60
|
* or Subscription if there are no resolvers for them.
|
|
55
61
|
*/
|
|
56
|
-
const sdl = schemaComposer.toSDL(
|
|
62
|
+
const sdl = schemaComposer.toSDL({
|
|
63
|
+
commentDescriptions: false,
|
|
64
|
+
omitDescriptions: true,
|
|
65
|
+
omitScalars: true,
|
|
66
|
+
});
|
|
57
67
|
|
|
58
68
|
graphql.validateSchema(schemaComposer.buildSchema());
|
|
59
69
|
|