Class GraphqlApi
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.appsync.GraphqlApiBase
software.amazon.awscdk.services.appsync.GraphqlApi
- All Implemented Interfaces:
IEnvironmentAware,IResource,IGraphqlApi,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-13T16:09:58.981Z")
@Stability(Stable)
public class GraphqlApi
extends GraphqlApiBase
An AppSync GraphQL API.
Example:
import software.amazon.awscdk.services.events.*;
GraphqlApi api = GraphqlApi.Builder.create(this, "EventBridgeApi")
.name("EventBridgeApi")
.definition(Definition.fromFile(join(__dirname, "appsync.eventbridge.graphql")))
.build();
EventBus bus = EventBus.Builder.create(this, "DestinationEventBus").build();
EventBridgeDataSource dataSource = api.addEventBridgeDataSource("NoneDS", bus);
dataSource.createResolver("EventResolver", BaseResolverProps.builder()
.typeName("Mutation")
.fieldName("emitEvent")
.requestMappingTemplate(MappingTemplate.fromFile("request.vtl"))
.responseMappingTemplate(MappingTemplate.fromFile("response.vtl"))
.build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.services.appsync.IGraphqlApi
IGraphqlApi.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedGraphqlApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedGraphqlApi(software.amazon.jsii.JsiiObjectRef objRef) GraphqlApi(software.constructs.Construct scope, String id, GraphqlApiProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEnvironmentVariable(String key, String value) Add an environment variable to the construct.addSchemaDependency(CfnResource construct) Add schema dependency to a given construct.static IGraphqlApifromGraphqlApiAttributes(software.constructs.Construct scope, String id, GraphqlApiAttributes attrs) Import a GraphQL API through this function.getApiId()an unique AWS AppSync GraphQL API identifier i.e.the configured API key, if present.The AppSyncDomainName of the associated custom domain.getArn()the ARN of the API.The GraphQL endpoint ARN.the URL of the endpoint created by AppSync.the CloudWatch Log Group for this API.getModes()The Authorization Types for this GraphQL Api.getName()the name of the API.the schema attached to this api (only available for GraphQL APIs, not available for merged APIs).the visibility of the API.Methods inherited from class software.amazon.awscdk.services.appsync.GraphqlApiBase
addDynamoDbDataSource, addDynamoDbDataSource, addElasticsearchDataSource, addElasticsearchDataSource, addEventBridgeDataSource, addEventBridgeDataSource, addHttpDataSource, addHttpDataSource, addLambdaDataSource, addLambdaDataSource, addNoneDataSource, addNoneDataSource, addOpenSearchDataSource, addOpenSearchDataSource, addRdsDataSource, addRdsDataSource, addRdsDataSource, addRdsDataSourceV2, addRdsDataSourceV2, addRdsDataSourceV2, createResolver, grant, grantMutation, grantQuery, grantSubscriptionMethods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourceMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getStackMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
Constructor Details
-
GraphqlApi
protected GraphqlApi(software.amazon.jsii.JsiiObjectRef objRef) -
GraphqlApi
protected GraphqlApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
GraphqlApi
@Stability(Stable) public GraphqlApi(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GraphqlApiProps props) - Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
-
Method Details
-
fromGraphqlApiAttributes
@Stability(Stable) @NotNull public static IGraphqlApi fromGraphqlApiAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GraphqlApiAttributes attrs) Import a GraphQL API through this function.- Parameters:
scope- scope. This parameter is required.id- id. This parameter is required.attrs- GraphQL API Attributes of an API. This parameter is required.
-
addEnvironmentVariable
Add an environment variable to the construct.- Parameters:
key- This parameter is required.value- This parameter is required.
-
addSchemaDependency
Add schema dependency to a given construct.- Specified by:
addSchemaDependencyin interfaceIGraphqlApi- Overrides:
addSchemaDependencyin classGraphqlApiBase- Parameters:
construct- the dependee. This parameter is required.
-
getApiId
an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.- Specified by:
getApiIdin interfaceIGraphqlApi- Specified by:
getApiIdin classGraphqlApiBase
-
getAppSyncDomainName
The AppSyncDomainName of the associated custom domain. -
getArn
the ARN of the API.- Specified by:
getArnin interfaceIGraphqlApi- Specified by:
getArnin classGraphqlApiBase
-
getGraphQLEndpointArn
The GraphQL endpoint ARN.- Specified by:
getGraphQLEndpointArnin interfaceIGraphqlApi- Specified by:
getGraphQLEndpointArnin classGraphqlApiBase
-
getGraphqlUrl
the URL of the endpoint created by AppSync. -
getLogGroup
the CloudWatch Log Group for this API. -
getModes
The Authorization Types for this GraphQL Api.- Specified by:
getModesin interfaceIGraphqlApi- Specified by:
getModesin classGraphqlApiBase
-
getName
the name of the API. -
getSchema
the schema attached to this api (only available for GraphQL APIs, not available for merged APIs). -
getVisibility
the visibility of the API.- Specified by:
getVisibilityin interfaceIGraphqlApi- Specified by:
getVisibilityin classGraphqlApiBase
-
getApiKey
the configured API key, if present.Default: - no api key
-