Skip to content

Commit 03dd5ca

Browse files
author
Dane Pilcher
committed
add details on values in context stash
1 parent 36d034a commit 03dd5ca

File tree

1 file changed

+9
-0
lines changed
  • src/pages/[platform]/build-a-backend/data/custom-business-logic/batch-ddb-operations

1 file changed

+9
-0
lines changed

src/pages/[platform]/build-a-backend/data/custom-business-logic/batch-ddb-operations/index.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ export const data = defineData({
104104
});
105105
```
106106

107+
Amplify will store some values in the resolver context stash that can be accessed in the custom resolver.
108+
109+
| Name | Description |
110+
| ----------------- | ------------------------------------------- |
111+
| awsAppsyncApiId | The ID of the AppSync API. |
112+
| amplifyBranchName | The Amplify branch name. (`NONE` in sandbox) |
113+
114+
The Amplify generated DynamoDB table names can be constructed from the variables in the context stash. The table name is in the format `<model-name>-<aws-appsync-api-id>-<amplify-branch-name>`. For example, the table name for the `Post` model would be `Post-123456-dev` where `123456` is the AppSync API ID and `dev` is the Amplify branch name.
115+
107116
```ts title="amplify/data/BatchCreatePostHandler.js"
108117
import { util } from '@aws-appsync/utils';
109118
export function request(ctx) {

0 commit comments

Comments
 (0)