Class GraphqlApi
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.appsync.GraphqlApiBase
software.amazon.awscdk.services.appsync.GraphqlApi
- All Implemented Interfaces:
IConstruct
,IDependable
,IResource
,IGraphqlApi
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:49.502Z")
@Stability(Experimental)
public class GraphqlApi
extends GraphqlApiBase
(experimental) An AppSync GraphQL API.
Example:
GraphqlApi api = GraphqlApi.Builder.create(this, "Api") .name("demo") .build(); ObjectType demo = ObjectType.Builder.create("Demo") .definition(Map.of( "id", GraphqlType.string(BaseTypeOptions.builder().isRequired(true).build()), "version", GraphqlType.string(BaseTypeOptions.builder().isRequired(true).build()))) .build(); api.addType(demo);
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
(experimental) A fluent builder forGraphqlApi
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.appsync.IGraphqlApi
IGraphqlApi.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
GraphqlApi
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
GraphqlApi
(software.amazon.jsii.JsiiObjectRef objRef) GraphqlApi
(software.constructs.Construct scope, String id, GraphqlApiProps props) -
Method Summary
Modifier and TypeMethodDescriptionaddMutation
(String fieldName, ResolvableField field) (experimental) Add a mutation field to the schema's Mutation.addQuery
(String fieldName, ResolvableField field) (experimental) Add a query field to the schema's Query.addSchemaDependency
(CfnResource construct) (experimental) Add schema dependency to a given construct.addSubscription
(String fieldName, ResolvableField field) (experimental) Add a subscription field to the schema's Subscription.void
addToSchema
(String addition) (experimental) Escape hatch to append to Schema as desired.void
addToSchema
(String addition, String delimiter) (experimental) Escape hatch to append to Schema as desired.addType
(IIntermediateType type) (experimental) Add type to the schema.static IGraphqlApi
fromGraphqlApiAttributes
(software.constructs.Construct scope, String id, GraphqlApiAttributes attrs) (experimental) Import a GraphQL API through this function.getApiId()
(experimental) an unique AWS AppSync GraphQL API identifier i.e.(experimental) the configured API key, if present.getArn()
(experimental) the ARN of the API.(experimental) the URL of the endpoint created by AppSync.getModes()
(experimental) The Authorization Types for this GraphQL Api.getName()
(experimental) the name of the API.(experimental) the schema attached to this api.grant
(IGrantable grantee, IamResource resources, @NotNull String... actions) (experimental) Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy.grantMutation
(IGrantable grantee, @NotNull String... fields) (experimental) Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.grantQuery
(IGrantable grantee, @NotNull String... fields) (experimental) Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy.grantSubscription
(IGrantable grantee, @NotNull String... fields) (experimental) Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy.Methods inherited from class software.amazon.awscdk.services.appsync.GraphqlApiBase
addDynamoDbDataSource, addDynamoDbDataSource, addElasticsearchDataSource, addElasticsearchDataSource, addHttpDataSource, addHttpDataSource, addLambdaDataSource, addLambdaDataSource, addNoneDataSource, addNoneDataSource, addOpenSearchDataSource, addOpenSearchDataSource, addRdsDataSource, addRdsDataSource, addRdsDataSource, createResolver
Methods inherited from class software.amazon.awscdk.core.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
Methods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
Methods inherited from class software.constructs.Construct
toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.awscdk.core.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.core.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
GraphqlApi
protected GraphqlApi(software.amazon.jsii.JsiiObjectRef objRef) -
GraphqlApi
protected GraphqlApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
GraphqlApi
@Stability(Experimental) 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(Experimental) @NotNull public static IGraphqlApi fromGraphqlApiAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull GraphqlApiAttributes attrs) (experimental) 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.
-
addMutation
@Stability(Experimental) @NotNull public ObjectType addMutation(@NotNull String fieldName, @NotNull ResolvableField field) (experimental) Add a mutation field to the schema's Mutation. CDK will create an Object Type called 'Mutation'. For example,.type Mutation { fieldName: Field.returnType }
- Parameters:
fieldName
- the name of the Mutation. This parameter is required.field
- the resolvable field to for this Mutation. This parameter is required.
-
addQuery
@Stability(Experimental) @NotNull public ObjectType addQuery(@NotNull String fieldName, @NotNull ResolvableField field) (experimental) Add a query field to the schema's Query. CDK will create an Object Type called 'Query'. For example,.type Query { fieldName: Field.returnType }
- Parameters:
fieldName
- the name of the query. This parameter is required.field
- the resolvable field to for this query. This parameter is required.
-
addSchemaDependency
@Stability(Experimental) @NotNull public Boolean addSchemaDependency(@NotNull CfnResource construct) (experimental) Add schema dependency to a given construct.- Specified by:
addSchemaDependency
in interfaceIGraphqlApi
- Overrides:
addSchemaDependency
in classGraphqlApiBase
- Parameters:
construct
- the dependee. This parameter is required.
-
addSubscription
@Stability(Experimental) @NotNull public ObjectType addSubscription(@NotNull String fieldName, @NotNull ResolvableField field) (experimental) Add a subscription field to the schema's Subscription. CDK will create an Object Type called 'Subscription'. For example,.type Subscription { fieldName: Field.returnType }
- Parameters:
fieldName
- the name of the Subscription. This parameter is required.field
- the resolvable field to for this Subscription. This parameter is required.
-
addToSchema
@Stability(Experimental) public void addToSchema(@NotNull String addition, @Nullable String delimiter) (experimental) Escape hatch to append to Schema as desired.Will always result in a newline.
Default: - ''
- Parameters:
addition
- the addition to add to schema. This parameter is required.delimiter
- the delimiter between schema and addition.
-
addToSchema
(experimental) Escape hatch to append to Schema as desired.Will always result in a newline.
Default: - ''
- Parameters:
addition
- the addition to add to schema. This parameter is required.
-
addType
(experimental) Add type to the schema.- Parameters:
type
- the intermediate type to add to the schema. This parameter is required.
-
grant
@Stability(Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull IamResource resources, @NotNull @NotNull String... actions) (experimental) Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy.- Parameters:
grantee
- The principal. This parameter is required.resources
- The set of resources to allow (i.e. ...:[region]:[accountId]:apis/GraphQLId/...). This parameter is required.actions
- The actions that should be granted to the principal (i.e. appsync:graphql ). This parameter is required.
-
grantMutation
@Stability(Experimental) @NotNull public Grant grantMutation(@NotNull IGrantable grantee, @NotNull @NotNull String... fields) (experimental) Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.- Parameters:
grantee
- The principal. This parameter is required.fields
- The fields to grant access to that are Mutations (leave blank for all). This parameter is required.
-
grantQuery
@Stability(Experimental) @NotNull public Grant grantQuery(@NotNull IGrantable grantee, @NotNull @NotNull String... fields) (experimental) Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy.- Parameters:
grantee
- The principal. This parameter is required.fields
- The fields to grant access to that are Queries (leave blank for all). This parameter is required.
-
grantSubscription
@Stability(Experimental) @NotNull public Grant grantSubscription(@NotNull IGrantable grantee, @NotNull @NotNull String... fields) (experimental) Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy.- Parameters:
grantee
- The principal. This parameter is required.fields
- The fields to grant access to that are Subscriptions (leave blank for all). This parameter is required.
-
getApiId
(experimental) an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.- Specified by:
getApiId
in interfaceIGraphqlApi
- Specified by:
getApiId
in classGraphqlApiBase
-
getArn
(experimental) the ARN of the API.- Specified by:
getArn
in interfaceIGraphqlApi
- Specified by:
getArn
in classGraphqlApiBase
-
getGraphqlUrl
(experimental) the URL of the endpoint created by AppSync. -
getModes
(experimental) The Authorization Types for this GraphQL Api. -
getName
(experimental) the name of the API. -
getSchema
(experimental) the schema attached to this api. -
getApiKey
(experimental) the configured API key, if present.Default: - no api key
-