-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
@aws-cdk/aws-appsyncRelated to AWS AppSyncRelated to AWS AppSynceffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.in-progressThis issue is being actively worked on.This issue is being actively worked on.p2
Description
Allow query definition for schema.
Use Case
Would allow for definition of query type fields alongside resolvers for a code-first approach.
Proposed Solution
const api = new GraphQLApi(stack, 'ExampleApi', {
name: 'example',
schemaDefinition: SCHEMA.CODE,
...
}
const example = api.addType('Example', {
definition: {
ScalarType.int('id').required(),
ScalarType.string('content').required(),
},
authorization: AUTH.AWS_IAM,
});
api.addQuery( 'getExamples', {
type: ScalarType.list.custom(example),
resolve: [{
dataSource: exampleDS,
request: MappingTemplate.dynamoDbScanTable(),
response: MappingTemplate.dynamoDbResultList(),
}],
});Query is defined through a code-first approach and resolvers are mapped inline.
Other
Tracked by: #9305
This is a 🚀 Feature Request
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-appsyncRelated to AWS AppSyncRelated to AWS AppSynceffort/mediumMedium work item – several days of effortMedium work item – several days of effortfeature-requestA feature should be added or improved.A feature should be added or improved.in-progressThis issue is being actively worked on.This issue is being actively worked on.p2