question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fails to start api mock w/unhelpful error message

See original GitHub issue

Describe the bug When trying to run a local mock of an API that is successfully deployed to the cloud using cli version 3.15.0, I get the following error:

Scanning for plugins...
Plugin scan successful

The following types do not have '@auth' enabled. Consider using @auth with @model
	 [redacted]
Learn more about @auth here: https://aws-amplify.github.io/docs/cli-toolchain/graphql#auth 


GraphQL schema compiled successfully.

Edit your schema at /[…]amplify/backend/api/[…]/schema.graphql or place .graphql files in a directory at /[…]amplify/backend/api/[…]/schema
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 TypeError: Cannot read property 'name' of undefined

Desktop (please complete the following information):

  • OS: macOS 10.15.1
  • CLI Tools v3.15.0
  • Node v10.16.3

Additional context My schema is fairly complex, comprising 30-some different data sources, custom resolvers and so on. I can push to AWS no problem, so not an enormous deal, but would be nice to have local mocking capability for testing our custom resolvers.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:17 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
overflowzcommented, Dec 15, 2020

Having the same issue here and been waiting for it for a long time now. Also, is the enhancement label correct here? Shouldn’t it be a bug since it causes mock to fail?

1reaction
yuthcommented, Feb 18, 2020

we could definately improve this and add support for all query/mutations except for the search* queries. Let me mark this as enhancement for mock

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mock API generation failing with unhelpful error message
I'm trying to get the SwaggerHub API Auto Mocking integration to work, but the integration keeps failing with "Could not generate API mock....
Read more >
Failed to start API Mock endpoint Error: CloudFormation stack ...
So your mock api would be up and running without a datastore and would not help in kind of local testing if you...
Read more >
Setting up mock servers | Postman Learning Center
Mock server quick start · In Postman, send a request to any API. · In the response pane, select Save Response > Save...
Read more >
Run your mock REST APIs anywhere with Mockoon CLI
Mockoon is a set of free and open-source API mocking tools. ... This tutorial will help you put up on track with the...
Read more >
Mock API Generation with Twilio's OpenAPI Spec
Congratulations on starting your (maybe first) Prism mock server! ... request as the real Twilio API would, and is throwing a 401 error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found