Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amplify mock not working #309

Open
vasujogani opened this issue May 20, 2020 · 17 comments
Open

amplify mock not working #309

vasujogani opened this issue May 20, 2020 · 17 comments

Comments

@vasujogani
Copy link

Note: If your question is regarding the AWS Amplify Console service, please log it in the
official AWS Amplify Console forum

Which Category is your question related to?
Mocking and Testing

Amplify CLI Version
4.20.0

What AWS Services are you utilizing?
Graphql, Elasticsearch (via @searchable)

Provide additional details e.g. code snippets
amplify mock

amplify mock fails

Mock does not handle CloudFormation resource of type AWS::Elasticsearch::Domain. Skipping processing resource ElasticSearchDomain.
Data source of type AMAZON_ELASTICSEARCH is not supported by local mocking. A NONE data source will be used.
Failed to start API Mock endpoint Error: Could not get resource ElasticSearchDomain

How can I bypass this?

Thanks

@weisisheng
Copy link

Interested in this. I started getting 404 on a previously running react page yesterday.

@vasujogani
Copy link
Author

@SwaySway any way to temporarily bypass this for now?

@SwaySway
Copy link
Contributor

The CLI does not support mocking of searchable.
A potential workaround for this would be to comment out searchable before running amplify mock.
As a takeaway action we can look into how we can still provide mock functionality.

@TheBox193
Copy link

TheBox193 commented Jun 9, 2020

+1 Commenting out searchable is not a great answer.

Update: Great news! We moved off Amplify and now no longer needs this. 😅

@dtelaroli
Copy link

+1

@chrisw-asu
Copy link

The CLI does not support mocking of searchable.
A potential workaround for this would be to comment out searchable before running amplify mock.
As a takeaway action we can look into how we can still provide mock functionality.
@SwaySway
Why did the amplify cli regress on this? version 4.12.0 of the amplify cli supports mocking ElasticSearchDomain.

@chrisw-asu
Copy link

It is totally not cool to break old functionality in your product when releasing new versions of it. This should really eliminate amplify cli from being considered for any applications uses.

@seanchatman
Copy link

Mocking of APIs breaks out of the box for the Todo app. Mocking of Lambdas breaks out of the box on the Hello World function. Does anyone even build this?

@mikerudge
Copy link

+1

@kevcam4891
Copy link

kevcam4891 commented Aug 28, 2020

+1 Any word on this? I'd really like to be able to launch graphiQL for the bulk of my local testing even if I have to stay away from search-related resolvers. Until then, I'm relegated to e2e testing direct with backend.

@tomyitav
Copy link

tomyitav commented Nov 2, 2020

My mock fails on @function annotation of mutation. any planned fixes for this?

@kldeb
Copy link

kldeb commented Jan 23, 2021

We're starting to feel the issue of not having local mocking that supports all the features we're using in amplify. When we onboard new developers they make frequent changes (especially to the schema) as they learn the project. Making frequent changes that require deployments slows them down quite a bit. I hope mock can catch up to more of the common features used in amplify projects.

@kldeb
Copy link

kldeb commented Feb 12, 2021

How about amplify mockcreates a copy of the schema and comments out the @searchable directives for me? That way I don't accidentally drop it in production when i yolo push my app.

@kldeb
Copy link

kldeb commented Apr 20, 2021

Another solution we're considering is removing @searchable from our schema and getting by with @keys. We don't think our users will notice since search is limited to a few fields.

@renebrandel
Copy link
Contributor

Hi folks - we're planning on addressing this as part of our new GraphQL transformer. The approach is captured here in our RFC: aws-amplify/amplify-cli#7546 love to hear your feedback!

@siegerts siegerts added the feature-request New feature or request label Sep 3, 2021
@MontoyaAndres
Copy link

any news?

@majirosstefan
Copy link

Or plans, estimates, when it could be released ?

@alharris-at alharris-at transferred this issue from aws-amplify/amplify-cli May 17, 2022
@SwaySway SwaySway removed their assignment Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests