class BaseDataSource
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.AppSync.BaseDataSource |
![]() | software.amazon.awscdk.services.appsync.BaseDataSource |
![]() | aws_cdk.aws_appsync.BaseDataSource |
![]() | @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
Backed
Data Source Props - extended
Extended
Data 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
Base
Appsync 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
Base
Resolver 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.