aws / aws/aws-appsync-community

'get' is not exported from '@aws-appsync/utils/dynamodb' (imported as 'ddb').

Open
#381 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
507
Forks
37
PR merge metrics
No merged PRs in 30d

Description

New to the appsync environment and trying to use Amplify to host an app, that connects to our DynamoDB data sources. Followed the Amplify docs [here](https://docs.amplify.aws/react/build-a-backend/data/connect-to-existing-data-sources/connect-external-ddb-table/). When doing npm run dev I get the below error:
`Attempted import error: 'get' is not exported from '@aws-appsync/utils/dynamodb' (imported as 'ddb').`

Here is the resolver js code I am using:
```
import * as ddb from "@aws-appsync/utils/dynamodb";

export function request(ctx) {
return ddb.get({
key: { aggregationKey: ctx.args.aggregationKey, metricId: ctx.args.metricId },
});
}

export const response = (ctx) => ctx.result;
```

I tried looking into the Appsync Documentation as well as online for more info but the AppSync documentation uses similar code [here](https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-resolvers-js.html#configure-getpost). Here are my versions below. If anything else is needed, lmk!

```
"@aws-amplify/api": "^6.1.7",
"@aws-amplify/ui-react": "^6.5.5",
"@aws-appsync/utils": "^1.12.0",
"aws-amplify": "^6.10.2",
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure with npm run dev using the resolver shown and @aws-appsync/utils ^1.12.0. Compare that package version with the Amplify and AWS AppSync documentation linked in the report; done means the documented example and supported package exports are consistent, or the incompatibility is clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, graphql, javascript
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.