1 | import { Handler } from '../handler';
|
2 |
|
3 | export type AppSyncResolverHandler<TArguments, TResults, TSource = Record<string, any> | null> = Handler<AppSyncResolverEvent<TArguments, TSource>, TResults | TResults[]>;
|
4 |
|
5 | export interface AppSyncResolverEventHeaders {
|
6 | [name: string]: string | undefined;
|
7 | }
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | export interface AppSyncResolverEvent<TArguments, TSource = Record<string, any> | null> {
|
16 | arguments: TArguments;
|
17 | identity?: AppSyncIdentityIAM | AppSyncIdentityCognito | undefined;
|
18 | source: TSource;
|
19 | request: {
|
20 | headers: AppSyncResolverEventHeaders;
|
21 | };
|
22 | info: {
|
23 | selectionSetList: string[];
|
24 | selectionSetGraphQL: string;
|
25 | parentTypeName: string;
|
26 | fieldName: string;
|
27 | variables: { [key: string]: any };
|
28 | };
|
29 | prev: { result: { [key: string]: any } } | null;
|
30 | stash: { [key: string]: any };
|
31 | }
|
32 |
|
33 | export interface AppSyncIdentityIAM {
|
34 | accountId: string;
|
35 | cognitoIdentityPoolId: string;
|
36 | cognitoIdentityId: string;
|
37 | sourceIp: string[];
|
38 | username: string;
|
39 | userArn: string;
|
40 | cognitoIdentityAuthType: string;
|
41 | cognitoIdentityAuthProvider: string;
|
42 | }
|
43 |
|
44 | export interface AppSyncIdentityCognito {
|
45 | sub: string;
|
46 | issuer: string;
|
47 | username: string;
|
48 | claims: any;
|
49 | sourceIp: string[];
|
50 | defaultAuthStrategy: string;
|
51 | groups: string[] | null;
|
52 | }
|