diff --git a/packages/core/src/singleton/API/types.ts b/packages/core/src/singleton/API/types.ts index 30fc8f6a0fa..4e81c2a966a 100644 --- a/packages/core/src/singleton/API/types.ts +++ b/packages/core/src/singleton/API/types.ts @@ -1,11 +1,17 @@ -// TODO V6 - Ivan will own this +// TODO V6 +/** + * exports file + * auth modes + * headers should be on second param + */ // import { DocumentNode } from 'graphql'; // TODO: update as this no longer exists: // import { GRAPHQL_AUTH_MODE } from '@aws-amplify/auth'; // See packages/api-graphql/src/types/index.ts -export type LibraryAPIGraphQLOptions = { +// custom headers, dynamic, etc. +export type LibraryAPIOptions = { AppSync: { // query: string | DocumentNode; query: string; @@ -19,13 +25,7 @@ export type LibraryAPIGraphQLOptions = { */ userAgentSuffix?: string; // TODO: remove in v6 }; -}; - -// TODO: simple config: -export type APIGraphQLConfig = { - apiKey?: string; - region?: string; - authMode?: string; + customHeaders: Function; // }; export type APIConfig = { diff --git a/packages/core/src/singleton/types.ts b/packages/core/src/singleton/types.ts index c2904852aba..65a0d3dcbdd 100644 --- a/packages/core/src/singleton/types.ts +++ b/packages/core/src/singleton/types.ts @@ -1,11 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import { - APIConfig, - APIGraphQLConfig, - LibraryAPIGraphQLOptions, -} from './API/types'; +import { APIConfig, LibraryAPIOptions } from './API/types'; import { AnalyticsConfig } from './Analytics/types'; import { AuthConfig, @@ -22,7 +18,6 @@ import { StorageConfig, } from './Storage/types'; -// TODO V6: API types?? export type ResourcesConfig = { API?: APIConfig; Analytics?: AnalyticsConfig; @@ -37,14 +32,15 @@ export type ResourcesConfig = { ssr?: boolean; }; +// Dynamic config export type LibraryOptions = { - APIGraphQL?: LibraryAPIGraphQLOptions; + API?: LibraryAPIOptions; Auth?: LibraryAuthOptions; Storage?: LibraryStorageOptions; }; export { - APIGraphQLConfig, + APIConfig, AuthConfig, AuthUserPoolConfig, AuthIdentityPoolConfig,