Custom resolvers are removed when the mock server is stopped
See original GitHub issueBefore 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
- Add a custom template to the resolvers dir
- Start the mock server
- Stop the mock server
- Observe that all templates are gone.
Log output
# Put your logs below this line
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The issue seems to generate from the
resolver-overrides.ts
file. I would like to work on this issue.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.