class BaseDataSource
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.AppSync.BaseDataSource |
Java | software.amazon.awscdk.services.appsync.BaseDataSource |
Python | aws_cdk.aws_appsync.BaseDataSource |
TypeScript (source) | @aws-cdk/aws-appsync » BaseDataSource |
Implements
IConstruct, IConstruct, IDependable
Extends
Construct
Implemented by
Dynamo, Elasticsearch, Http, Lambda, None, Open, Rds
Abstract AppSync datasource implementation.
Do not use directly but use subclasses for concrete datasources
Example
declare const api: appsync.GraphqlApi;
declare const dummyRequest: appsync.MappingTemplate;
declare const dummyResponse: appsync.MappingTemplate;
const info = new appsync.ObjectType('Info', {
definition: {
node: new appsync.ResolvableField({
returnType: appsync.GraphqlType.string(),
args: {
id: appsync.GraphqlType.string(),
},
dataSource: api.addNoneDataSource('none'),
requestMappingTemplate: dummyRequest,
responseMappingTemplate: dummyResponse,
}),
},
});
Initializer
new BaseDataSource(scope: Construct, id: string, props: BackedDataSourceProps, extended: ExtendedDataSourceProps)
Parameters
- scope
Construct - id
string - props
BackedData Source Props - extended
ExtendedData Source Props
Properties
| Name | Type | Description |
|---|---|---|
| api | IGraphql | |
| ds | Cfn | the underlying CFN data source resource. |
| name | string | the name of the data source. |
| node | Construct | The construct tree node associated with this construct. |
| service | IRole |
api
Type:
IGraphql
ds
Type:
Cfn
the underlying CFN data source resource.
name
Type:
string
the name of the data source.
node
Type:
Construct
The construct tree node associated with this construct.
serviceRole?
Type:
IRole
(optional)
Methods
| Name | Description |
|---|---|
| create | creates a new appsync function for this datasource and API using the given properties. |
| create | creates a new resolver for this datasource and API using the given properties. |
| to | Returns a string representation of this construct. |
createFunction(props)
public createFunction(props: BaseAppsyncFunctionProps): AppsyncFunction
Parameters
- props
BaseAppsync Function Props
Returns
creates a new appsync function for this datasource and API using the given properties.
createResolver(props)
public createResolver(props: BaseResolverProps): Resolver
Parameters
- props
BaseResolver Props
Returns
creates a new resolver for this datasource and API using the given properties.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.

.NET
Java
Python
TypeScript (