Skip to content

Commit b9069e1

Browse files
committed
Changes to fix function data config
1 parent fe6caeb commit b9069e1

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/backend-function/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
"@aws-amplify/backend-output-schemas": "^1.4.0",
2828
"@aws-amplify/backend-output-storage": "^1.1.3",
2929
"@aws-amplify/plugin-types": "^1.4.0",
30+
"@aws-sdk/client-s3": "^3.624.0",
3031
"execa": "^8.0.1"
3132
},
3233
"devDependencies": {
3334
"@aws-amplify/backend-platform-test-stubs": "^0.3.6",
3435
"@aws-amplify/platform-core": "^1.1.0",
35-
"@aws-sdk/client-s3": "^3.624.0",
3636
"@aws-sdk/client-ssm": "^3.624.0",
3737
"aws-sdk": "^2.1550.0",
3838
"uuid": "^9.0.1"

packages/backend-function/src/runtime/get_amplify_clients_configuration.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const getResourceConfig = (
4949
endpoint: env.AMPLIFY_DATA_GRAPHQL_ENDPOINT,
5050
region: env.AWS_REGION,
5151
defaultAuthMode: 'iam' as const,
52-
modelIntrospection: modelIntrospectionSchema,
52+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
53+
modelIntrospection: modelIntrospectionSchema as any,
5354
},
5455
},
5556
};
@@ -74,10 +75,15 @@ const getLibraryOptions = (env: DataClientEnv) => {
7475
};
7576
};
7677

78+
type InvalidConfig = unknown & {
79+
invalidType: 'This function needs to be granted `authorization((allow) => [allow.resource(fcn)])` on the data schema.';
80+
};
81+
7782
type DataClientError = {
78-
resourceConfig: Record<string, unknown>;
79-
libraryOptions: Record<string, unknown>;
83+
resourceConfig: InvalidConfig;
84+
libraryOptions: InvalidConfig;
8085
};
86+
8187
type DataClientConfig = {
8288
resourceConfig: ReturnType<typeof getResourceConfig>;
8389
libraryOptions: ReturnType<typeof getLibraryOptions>;

0 commit comments

Comments
 (0)