@Generated(value="jsii-pacmak/1.63.2 (build a8a8833)", date="2022-08-17T17:31:22.743Z") public class GraphqlApi extends GraphqlApiBase
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);
Modifier and Type | Class and Description |
---|---|
static class |
GraphqlApi.Builder
(experimental) A fluent builder for
GraphqlApi . |
IGraphqlApi.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
GraphqlApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
GraphqlApi(software.amazon.jsii.JsiiObjectRef objRef) |
|
GraphqlApi(software.constructs.Construct scope,
java.lang.String id,
GraphqlApiProps props) |
Modifier and Type | Method and Description |
---|---|
ObjectType |
addMutation(java.lang.String fieldName,
ResolvableField field)
(experimental) Add a mutation field to the schema's Mutation.
|
ObjectType |
addQuery(java.lang.String fieldName,
ResolvableField field)
(experimental) Add a query field to the schema's Query.
|
java.lang.Boolean |
addSchemaDependency(CfnResource construct)
(experimental) Add schema dependency to a given construct.
|
ObjectType |
addSubscription(java.lang.String fieldName,
ResolvableField field)
(experimental) Add a subscription field to the schema's Subscription.
|
void |
addToSchema(java.lang.String addition)
(experimental) Escape hatch to append to Schema as desired.
|
void |
addToSchema(java.lang.String addition,
java.lang.String delimiter)
(experimental) Escape hatch to append to Schema as desired.
|
IIntermediateType |
addType(IIntermediateType type)
(experimental) Add type to the schema.
|
static IGraphqlApi |
fromGraphqlApiAttributes(software.constructs.Construct scope,
java.lang.String id,
GraphqlApiAttributes attrs)
(experimental) Import a GraphQL API through this function.
|
java.lang.String |
getApiId()
(experimental) an unique AWS AppSync GraphQL API identifier i.e.
|
java.lang.String |
getApiKey()
(experimental) the configured API key, if present.
|
java.lang.String |
getArn()
(experimental) the ARN of the API.
|
java.lang.String |
getGraphqlUrl()
(experimental) the URL of the endpoint created by AppSync.
|
java.util.List<AuthorizationType> |
getModes()
(experimental) The Authorization Types for this GraphQL Api.
|
java.lang.String |
getName()
(experimental) the name of the API.
|
Schema |
getSchema()
(experimental) the schema attached to this api.
|
Grant |
grant(IGrantable grantee,
IamResource resources,
java.lang.String... actions)
(experimental) Adds an IAM policy statement associated with this GraphQLApi to an IAM principal's policy.
|
Grant |
grantMutation(IGrantable grantee,
java.lang.String... fields)
(experimental) Adds an IAM policy statement for Mutation access to this GraphQLApi to an IAM principal's policy.
|
Grant |
grantQuery(IGrantable grantee,
java.lang.String... fields)
(experimental) Adds an IAM policy statement for Query access to this GraphQLApi to an IAM principal's policy.
|
Grant |
grantSubscription(IGrantable grantee,
java.lang.String... fields)
(experimental) Adds an IAM policy statement for Subscription access to this GraphQLApi to an IAM principal's policy.
|
addDynamoDbDataSource, addDynamoDbDataSource, addElasticsearchDataSource, addElasticsearchDataSource, addHttpDataSource, addHttpDataSource, addLambdaDataSource, addLambdaDataSource, addNoneDataSource, addNoneDataSource, addOpenSearchDataSource, addOpenSearchDataSource, addRdsDataSource, addRdsDataSource, addRdsDataSource, createResolver
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected GraphqlApi(software.amazon.jsii.JsiiObjectRef objRef)
protected GraphqlApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public GraphqlApi(software.constructs.Construct scope, java.lang.String id, GraphqlApiProps props)
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.public static IGraphqlApi fromGraphqlApiAttributes(software.constructs.Construct scope, java.lang.String id, GraphqlApiAttributes attrs)
scope
- scope. This parameter is required.id
- id. This parameter is required.attrs
- GraphQL API Attributes of an API. This parameter is required.public ObjectType addMutation(java.lang.String fieldName, ResolvableField field)
type Mutation { fieldName: Field.returnType }
fieldName
- the name of the Mutation. This parameter is required.field
- the resolvable field to for this Mutation. This parameter is required.public ObjectType addQuery(java.lang.String fieldName, ResolvableField field)
type Query { fieldName: Field.returnType }
fieldName
- the name of the query. This parameter is required.field
- the resolvable field to for this query. This parameter is required.public java.lang.Boolean addSchemaDependency(CfnResource construct)
addSchemaDependency
in interface IGraphqlApi
addSchemaDependency
in class GraphqlApiBase
construct
- the dependee. This parameter is required.public ObjectType addSubscription(java.lang.String fieldName, ResolvableField field)
type Subscription { fieldName: Field.returnType }
fieldName
- the name of the Subscription. This parameter is required.field
- the resolvable field to for this Subscription. This parameter is required.public void addToSchema(java.lang.String addition, java.lang.String delimiter)
Will always result in a newline.
Default: - ''
addition
- the addition to add to schema. This parameter is required.delimiter
- the delimiter between schema and addition.public void addToSchema(java.lang.String addition)
Will always result in a newline.
Default: - ''
addition
- the addition to add to schema. This parameter is required.public IIntermediateType addType(IIntermediateType type)
type
- the intermediate type to add to the schema. This parameter is required.public Grant grant(IGrantable grantee, IamResource resources, java.lang.String... actions)
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.public Grant grantMutation(IGrantable grantee, java.lang.String... fields)
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.public Grant grantQuery(IGrantable grantee, java.lang.String... fields)
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.public Grant grantSubscription(IGrantable grantee, java.lang.String... fields)
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.public java.lang.String getApiId()
getApiId
in interface IGraphqlApi
getApiId
in class GraphqlApiBase
public java.lang.String getArn()
getArn
in interface IGraphqlApi
getArn
in class GraphqlApiBase
public java.lang.String getGraphqlUrl()
public java.util.List<AuthorizationType> getModes()
public java.lang.String getName()
public Schema getSchema()
public java.lang.String getApiKey()
Default: - no api key