-
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 subscription definition for schema.
Use Case
Would allow for definition of subscription 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.addSubscription( 'addExample', {
type: ObjectType.custom(example),
args: {
version: {
type: type.string(),
required: true,
},
},
mutations: [
addExample,
],
});Subscription is defined through a code-first approach and resolvers are mapped inline.
Other
Subscriptions in AWS AppSync are invoked as a response to a mutation. You configure this with a Subscription type and @aws_subscribe() directive in the schema to denote which mutations invoke one or more subscriptions. For more information about configuring subscriptions, see here.
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