aws-amplify / aws-amplify/amplify-cli

Allow local testing when referencing lambdas in schema that exist outside project

Open
#3,949 0 comments 0 reactions 0 assignees View on GitHub
feature-request mock p3
Dominant language
TypeScript
Stars
2.9k
Forks
825
Avg merge
11d 23h
Merged PRs (30d)
2

Description

**Is your feature request related to a problem? Please describe.**
I would like to submit a pull request to change this line in `packages/amplify-util-mock/src/api/api.ts`:

```js
throw new Error(
'Local mocking does not support AWS_LAMBDA data source that is not provisioned in the project.\nEnsure that the environment is specified as described in https://aws-amplify.github.io/docs/cli-toolchain/graphql#function',
);
```
To be a warning. I would still like to test other functions that are part of the amplify project locally.

**Describe the solution you'd like**
Just warn the user instead of throwing an error.

**Describe alternatives you've considered**
commenting out the code that references functions that are not part of the project, but then the risk is committing it to the repo accidentally.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.