@awsless/awsless 0.0.186 → 0.0.188
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/bin.js +11 -14
- package/package.json +4 -4
package/dist/bin.js
CHANGED
|
@@ -2640,10 +2640,6 @@ export function response(ctx) {
|
|
|
2640
2640
|
return ctx.result
|
|
2641
2641
|
}
|
|
2642
2642
|
`;
|
|
2643
|
-
var baseSchema = `
|
|
2644
|
-
type Query
|
|
2645
|
-
type Mutation
|
|
2646
|
-
`;
|
|
2647
2643
|
var scalarSchema = `
|
|
2648
2644
|
scalar AWSDate
|
|
2649
2645
|
scalar AWSTime
|
|
@@ -2789,8 +2785,9 @@ var graphqlFeature = defineFeature({
|
|
|
2789
2785
|
);
|
|
2790
2786
|
}
|
|
2791
2787
|
const group = new Node6(ctx.stack, "graphql", id);
|
|
2788
|
+
const name = formatLocalResourceName(ctx.app.name, ctx.stack.name, "graphql", id);
|
|
2792
2789
|
const api = new aws6.appsync.GraphQLApi(group, "api", {
|
|
2793
|
-
name
|
|
2790
|
+
name,
|
|
2794
2791
|
// visibility: false,
|
|
2795
2792
|
auth: {
|
|
2796
2793
|
default: {
|
|
@@ -2798,13 +2795,13 @@ var graphqlFeature = defineFeature({
|
|
|
2798
2795
|
}
|
|
2799
2796
|
}
|
|
2800
2797
|
});
|
|
2801
|
-
ctx.registerBuild("graphql-schema",
|
|
2798
|
+
ctx.registerBuild("graphql-schema", name, async (build3) => {
|
|
2802
2799
|
const source = await readFile5(props.schema, "utf8");
|
|
2803
2800
|
const finger = createHash4("sha1").update(source).digest("hex");
|
|
2804
2801
|
return build3(finger, async (write) => {
|
|
2805
|
-
const defs = mergeTypeDefs([scalarSchema,
|
|
2806
|
-
const
|
|
2807
|
-
const
|
|
2802
|
+
const defs = mergeTypeDefs([scalarSchema, source]);
|
|
2803
|
+
const output = print(defs);
|
|
2804
|
+
const schema2 = buildSchema(output);
|
|
2808
2805
|
for (const [typeName, fields] of Object.entries(props.resolvers ?? {})) {
|
|
2809
2806
|
const type = schema2.getType(typeName);
|
|
2810
2807
|
if (!type || !isObjectType(type)) {
|
|
@@ -2828,7 +2825,7 @@ var graphqlFeature = defineFeature({
|
|
|
2828
2825
|
});
|
|
2829
2826
|
const schema = new aws6.appsync.GraphQLSchema(group, "schema", {
|
|
2830
2827
|
apiId: api.id,
|
|
2831
|
-
definition: Asset2.fromFile(getBuildPath("graphql-schema",
|
|
2828
|
+
definition: Asset2.fromFile(getBuildPath("graphql-schema", name, "schema.gql"))
|
|
2832
2829
|
});
|
|
2833
2830
|
const association = new aws6.appsync.SourceApiAssociation(group, "association", {
|
|
2834
2831
|
mergedApiId: ctx.shared.get(`graphql-${id}-id`),
|
|
@@ -2837,8 +2834,8 @@ var graphqlFeature = defineFeature({
|
|
|
2837
2834
|
association.dependsOn(schema);
|
|
2838
2835
|
for (const [typeName, fields] of Object.entries(props.resolvers ?? {})) {
|
|
2839
2836
|
for (const [fieldName, props2] of Object.entries(fields ?? {})) {
|
|
2840
|
-
const
|
|
2841
|
-
const resolverGroup = new Node6(group, "resolver",
|
|
2837
|
+
const name2 = `${typeName}__${fieldName}`;
|
|
2838
|
+
const resolverGroup = new Node6(group, "resolver", name2);
|
|
2842
2839
|
const entryId = paramCase5(`${id}-${typeName}-${fieldName}`);
|
|
2843
2840
|
const { lambda } = createLambdaFunction(resolverGroup, ctx, `graphql`, entryId, {
|
|
2844
2841
|
...props2.consumer,
|
|
@@ -2861,7 +2858,7 @@ var graphqlFeature = defineFeature({
|
|
|
2861
2858
|
const source = new aws6.appsync.DataSource(resolverGroup, "source", {
|
|
2862
2859
|
apiId: api.id,
|
|
2863
2860
|
type: "lambda",
|
|
2864
|
-
name,
|
|
2861
|
+
name: name2,
|
|
2865
2862
|
role: role.arn,
|
|
2866
2863
|
functionArn: lambda.arn
|
|
2867
2864
|
});
|
|
@@ -2873,7 +2870,7 @@ var graphqlFeature = defineFeature({
|
|
|
2873
2870
|
}
|
|
2874
2871
|
const config2 = new aws6.appsync.FunctionConfiguration(resolverGroup, "config", {
|
|
2875
2872
|
apiId: api.id,
|
|
2876
|
-
name,
|
|
2873
|
+
name: name2,
|
|
2877
2874
|
code,
|
|
2878
2875
|
dataSourceName: source.name
|
|
2879
2876
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.188",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@awsless/
|
|
31
|
+
"@awsless/redis": "^0.0.12",
|
|
32
32
|
"@awsless/s3": "^0.0.10",
|
|
33
33
|
"@awsless/sns": "^0.0.7",
|
|
34
|
-
"@awsless/
|
|
34
|
+
"@awsless/lambda": "^0.0.18",
|
|
35
35
|
"@awsless/sqs": "^0.0.7",
|
|
36
36
|
"@awsless/ssm": "^0.0.7",
|
|
37
37
|
"@awsless/validate": "^0.0.13",
|
|
@@ -96,9 +96,9 @@
|
|
|
96
96
|
"wrap-ansi": "^8.1.0",
|
|
97
97
|
"zod": "^3.21.4",
|
|
98
98
|
"zod-to-json-schema": "^3.22.3",
|
|
99
|
-
"@awsless/formation": "^0.0.12",
|
|
100
99
|
"@awsless/duration": "^0.0.1",
|
|
101
100
|
"@awsless/size": "^0.0.1",
|
|
101
|
+
"@awsless/formation": "^0.0.12",
|
|
102
102
|
"@awsless/graphql": "^0.0.9",
|
|
103
103
|
"@awsless/validate": "^0.0.13",
|
|
104
104
|
"@awsless/code": "^0.0.10"
|