@aws-amplify/graphql-transformer-core
Version:
A framework to transform from GraphQL SDL to AWS CloudFormation.
59 lines • 2.62 kB
TypeScript
import { AssetProvider, GraphQLAPIProvider, TransformHostProvider, LogConfig } from '@aws-amplify/graphql-transformer-interfaces';
import { ApiKeyConfig, AuthorizationConfig, AuthorizationType, GraphqlApiBase, CfnApiKey, Visibility, IamResource } from 'aws-cdk-lib/aws-appsync';
import { Grant, IGrantable } from 'aws-cdk-lib/aws-iam';
import { CfnResource } from 'aws-cdk-lib';
import { Construct } from 'constructs';
import { TransformerSchema } from './cdk-compat/schema-asset';
export interface GraphqlApiProps {
readonly name: string;
readonly authorizationConfig?: AuthorizationConfig;
readonly logging?: true | LogConfig;
readonly schema?: TransformerSchema;
readonly xrayEnabled?: boolean;
}
export type TransformerAPIProps = GraphqlApiProps & {
readonly createApiKey?: boolean;
readonly host?: TransformHostProvider;
readonly sandboxModeEnabled?: boolean;
readonly environmentName?: string;
readonly disableResolverDeduping?: boolean;
readonly assetProvider: AssetProvider;
};
export declare class GraphQLApi extends GraphqlApiBase implements GraphQLAPIProvider {
readonly apiId: string;
readonly host: TransformHostProvider;
readonly arn: string;
readonly graphqlUrl: string;
readonly name: string;
readonly schema: TransformerSchema;
readonly modes: AuthorizationType[];
readonly apiKey?: string;
readonly sandboxModeEnabled?: boolean;
readonly disableResolverDeduping?: boolean;
readonly environmentName?: string;
readonly assetProvider: AssetProvider;
readonly graphQLEndpointArn: string;
readonly visibility: Visibility;
private schemaResource;
private api;
private apiKeyResource?;
private authorizationConfig?;
constructor(scope: Construct, id: string, props: TransformerAPIProps);
grant(grantee: IGrantable, resources: IamResource, ...actions: string[]): Grant;
grantQuery(grantee: IGrantable, ...fields: string[]): Grant;
grantMutation(grantee: IGrantable, ...fields: string[]): Grant;
grantSubscription(grantee: IGrantable, ...fields: string[]): Grant;
createAPIKey(config?: ApiKeyConfig): CfnApiKey;
addToSchema(content: string): void;
getDefaultAuthorization(): any;
private validateAuthorizationProps;
addSchemaDependency(construct: CfnResource): boolean;
private setupLogConfig;
private setupOpenIdConnectConfig;
private setupUserPoolConfig;
private setupLambdaConfig;
private lambdaArnKey;
private setupAdditionalAuthorizationModes;
private getAppSyncLogGroupName;
}
//# sourceMappingURL=graphql-api.d.ts.map