Class GraphqlApi
An AppSync GraphQL API.
Inherited Members
Namespace: Amazon.CDK.AWS.AppSync
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class GraphqlApi : GraphqlApiBase, IGraphqlApi, IResource
Syntax (vb)
Public Class GraphqlApi
Inherits GraphqlApiBase
Implements IGraphqlApi, IResource
Remarks
Resource: AWS::AppSync::GraphQLApi
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.Events;
var api = new GraphqlApi(this, "EventBridgeApi", new GraphqlApiProps {
Name = "EventBridgeApi",
Definition = Definition.FromFile(Join(__dirname, "appsync.eventbridge.graphql"))
});
var bus = new EventBus(this, "DestinationEventBus", new EventBusProps { });
var dataSource = api.AddEventBridgeDataSource("NoneDS", bus);
dataSource.CreateResolver("EventResolver", new BaseResolverProps {
TypeName = "Mutation",
FieldName = "emitEvent",
RequestMappingTemplate = MappingTemplate.FromFile("request.vtl"),
ResponseMappingTemplate = MappingTemplate.FromFile("response.vtl")
});
Synopsis
Constructors
GraphqlApi(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
GraphqlApi(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
GraphqlApi(Construct, String, IGraphqlApiProps) |
Properties
ApiId | an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'. |
ApiKey | the configured API key, if present. |
AppSyncDomainName | The AppSyncDomainName of the associated custom domain. |
Arn | the ARN of the API. |
GraphqlUrl | the URL of the endpoint created by AppSync. |
LogGroup | the CloudWatch Log Group for this API. |
Modes | The Authorization Types for this GraphQL Api. |
Name | the name of the API. |
Schema | the schema attached to this api (only available for GraphQL APIs, not available for merged APIs). |
Methods
AddEnvironmentVariable(String, String) | Add an environment variable to the construct. |
AddSchemaDependency(CfnResource) | Add schema dependency to a given construct. |
FromGraphqlApiAttributes(Construct, String, IGraphqlApiAttributes) | Import a GraphQL API through this function. |
Constructors
GraphqlApi(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected GraphqlApi(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
GraphqlApi(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected GraphqlApi(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
GraphqlApi(Construct, String, IGraphqlApiProps)
public GraphqlApi(Construct scope, string id, IGraphqlApiProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IGraphqlApiProps
Properties
ApiId
an unique AWS AppSync GraphQL API identifier i.e. 'lxz775lwdrgcndgz3nurvac7oa'.
public override string ApiId { get; }
Property Value
System.String
Overrides
ApiKey
the configured API key, if present.
public virtual string ApiKey { get; }
Property Value
System.String
Remarks
Default: - no api key
AppSyncDomainName
The AppSyncDomainName of the associated custom domain.
public virtual string AppSyncDomainName { get; }
Property Value
System.String
Arn
the ARN of the API.
public override string Arn { get; }
Property Value
System.String
Overrides
GraphqlUrl
the URL of the endpoint created by AppSync.
public virtual string GraphqlUrl { get; }
Property Value
System.String
Remarks
Attribute: GraphQlUrl
LogGroup
the CloudWatch Log Group for this API.
public virtual ILogGroup LogGroup { get; }
Property Value
Modes
The Authorization Types for this GraphQL Api.
public virtual AuthorizationType[] Modes { get; }
Property Value
Name
the name of the API.
public virtual string Name { get; }
Property Value
System.String
Schema
the schema attached to this api (only available for GraphQL APIs, not available for merged APIs).
public virtual ISchema Schema { get; }
Property Value
Methods
AddEnvironmentVariable(String, String)
Add an environment variable to the construct.
public virtual void AddEnvironmentVariable(string key, string value)
Parameters
- key System.String
- value System.String
AddSchemaDependency(CfnResource)
Add schema dependency to a given construct.
public override bool AddSchemaDependency(CfnResource construct)
Parameters
- construct CfnResource
the dependee.
Returns
System.Boolean
Overrides
FromGraphqlApiAttributes(Construct, String, IGraphqlApiAttributes)
Import a GraphQL API through this function.
public static IGraphqlApi FromGraphqlApiAttributes(Construct scope, string id, IGraphqlApiAttributes attrs)
Parameters
- scope Constructs.Construct
scope.
- id System.String
id.
- attrs IGraphqlApiAttributes
GraphQL API Attributes of an API.
Returns