From 854d0d086e367aca4dd1bfed52a32a6e44d5326e Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Mon, 12 Feb 2024 09:43:24 -0800 Subject: [PATCH] resolve comments --- packages/api-graphql/src/internals/generateClient.ts | 2 +- .../src/internals/utils/generateEnumsProperty.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/api-graphql/src/internals/generateClient.ts b/packages/api-graphql/src/internals/generateClient.ts index 9c6fc0297d3..8c40fdf65dc 100644 --- a/packages/api-graphql/src/internals/generateClient.ts +++ b/packages/api-graphql/src/internals/generateClient.ts @@ -84,7 +84,7 @@ const emptyProperty = new Proxy( { get() { throw new Error( - 'Client is not generate. This is likely due to `Amplify.configure()` not being called prior to `generateClient()` or because the configuration passed to `Amplify.configure()` is missing GraphQL provider configuration.', + 'Client could not be generate. This is likely due to `Amplify.configure()` not being called prior to `generateClient()` or because the configuration passed to `Amplify.configure()` is missing GraphQL provider configuration.', ); }, }, diff --git a/packages/api-graphql/src/internals/utils/generateEnumsProperty.ts b/packages/api-graphql/src/internals/utils/generateEnumsProperty.ts index 80840941e6e..492c6fa4f59 100644 --- a/packages/api-graphql/src/internals/utils/generateEnumsProperty.ts +++ b/packages/api-graphql/src/internals/utils/generateEnumsProperty.ts @@ -1,7 +1,10 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import { ModelIntrospectionSchema, GraphQLProviderConfig } from '@aws-amplify/core/internals/utils'; +import { + ModelIntrospectionSchema, + GraphQLProviderConfig, +} from '@aws-amplify/core/internals/utils'; import { EnumTypes } from '@aws-amplify/data-schema-types'; export const generateEnumsProperty = = never>( @@ -15,7 +18,7 @@ export const generateEnumsProperty = = never>( } const enums: { - [EnumName in keyof typeof modelIntrospection.enums]: { + [EnumName: string]: { values: () => string[]; }; } = {};