publishToUser
SRP
Publishes data to the user subscription channel. This mutation is IAM-authenticated (@aws_iam) and is used internally by the system to push real-time notifications.
For the canonical subscription payload contract, see:
Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
userId | ID! | Yes | The user to publish to |
data | AWSJSON! | Yes | JSON-encoded event envelope |
Return Type
UserFeedback — contains userId and data.
Example
mutation PublishToUser {
publishToUser(
userId: "dXNyMTIzNDU2"
data: "{\"version\":\"1.0\",\"eventId\":\"evt123\",\"timestamp\":\"2026-04-24T10:38:36.822Z\",\"level\":\"INFO\",\"event\":\"uploadCompleted\",\"category\":\"upload\",\"groupId\":null,\"userId\":\"dXNyMTIzNDU2\",\"requestId\":null,\"batchId\":null,\"error\":null,\"data\":{\"id\":\"tmp123\",\"key\":\"upload/usr123/tmp123.pdf\",\"code\":\"UPLOADOK\"}}"
) {
userId
data
}
}
The GraphQL result wrapper still returns:
userIddata
The data field itself is the JSON-encoded event envelope.