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.

Custom resolvers are removed when the mock server is stopped

See original GitHub issue

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

4.45.2

What operating system are you using?

mac

Amplify Categories

Not applicable

Amplify Commands

Not applicable

Describe the bug

I’ve created a custom resolvers to overwrite a standard resolver and placed it in

<rootDir>mplify/backend/api/rcv/resolvers

Then I started the local backend server with

amplify mock

The server added its own resolver templates into this directory, and when I stopped it, all the templates were gone, including my custom template.

Expected behavior

See the description

Reproduction steps

  1. Add a custom template to the resolvers dir
  2. Start the mock server
  3. Stop the mock server
  4. Observe that all templates are gone.

Log output

# Put your logs below this line

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gitaalekhyapaulcommented, Mar 16, 2021

The issue seems to generate from the resolver-overrides.ts file. I would like to work on this issue.

0reactions
github-actions[bot]commented, May 24, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Closing the mock api Server removes custom auth resolvers
B. When you start amplify mock api without a custom auth resolver, but then edit a script-copied auth resolver in <root>/amplify/backend/api/< ...
Read more >
Mocking - Apollo GraphQL Docs
You can do this by creating a customized mock with resolvers for each custom scalar type, as described below. Customizing mocks. In the...
Read more >
Advanced workflows - Mocking and testing - AWS Amplify Docs
Learn how to quickly test and debug without pushing all changes in your Amplify project to the cloud. Use local mocking and testing...
Read more >
resetHandlers() - Api - Mock Service Worker Docs
resetHandlers (). Removes any request handlers that were added on runtime (after the initial setupServer call). This function accepts an optional ...
Read more >
Typing and mocking a GraphQL API server with Apollo
But let's make the mock data resemble our expected data better. Custom mock resolvers. Pass an object to the mocks option to enable...
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