graphql-tools
graphql-tools copied to clipboard
Can't mock nested field resolvers
Issue workflow progress
Progress of the issue based on the Contributor Workflow
- [x] 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox
Make sure to fork this template and run
yarn generatein the terminal.Please make sure the GraphQL Tools package versions under
package.jsonmatches yours. - [x] 2. A failing test has been provided
- [ ] 3. A local solution has been provided
- [ ] 4. A pull request is pending review
Describe the bug
When mocking a nested root query, I can override any simple field, but overriding resolver fields doesn't work.
To Reproduce
Here is a test showing the problem
You can run the test in my fork, or just copy over the test.
Expected behavior
I expect returnStringArgument to have the value Overridden, but I get the default string value Hello World.
Environment:
- OS: OSX
@graphql-tools/mock:- NodeJS: v16.18.0
Additional context
I'm trying to fix a problem we are seeing in another tool graphql-fakester