Skip to content

Commit 9abb485

Browse files
committed
refactor(event-handler): mark identity field as unknown in event
1 parent 6fef7bc commit 9abb485

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/event-handler/src/types/appsync-events.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ type RouteOptions<T extends boolean | undefined = false> = {
162162
// #region Events
163163

164164
type AppSyncEventsEvent = {
165-
identity: null;
165+
identity: unknown;
166166
result: null;
167167
request: {
168168
headers: Record<string, string>;
@@ -188,6 +188,11 @@ type AppSyncEventsEvent = {
188188
/**
189189
* Event type for AppSync Events publish events.
190190
*
191+
* The `identity` field is marked as `unknown` because it varies based on the authentication type used in AppSync.
192+
* When using an API key, it will be `null`. When using IAM, it will contain the AWS credentials of the user. When using Cognito,
193+
* it will contain the Cognito user pool information. When using a Lambda authorizer, it will contain the information returned
194+
* by the authorizer.
195+
*
191196
* @example
192197
* ```json
193198
* {
@@ -243,6 +248,11 @@ type AppSyncEventsPublishEvent = AppSyncEventsEvent & {
243248
/**
244249
* Event type for AppSync Events subscribe events.
245250
*
251+
* The `identity` field is marked as `unknown` because it varies based on the authentication type used in AppSync.
252+
* When using an API key, it will be `null`. When using IAM, it will contain the AWS credentials of the user. When using Cognito,
253+
* it will contain the Cognito user pool information. When using a Lambda authorizer, it will contain the information returned
254+
* by the authorizer.
255+
*
246256
* @example
247257
* ```json
248258
* {

0 commit comments

Comments
 (0)