Skip to content

Can't mock nested field resolvers  #4848

@sunesimonsen

Description

@sunesimonsen

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • 1. The issue provides a reproduction available on Github, Stackblitz or CodeSandbox

    Make sure to fork this template and run yarn generate in the terminal.

    Please make sure the GraphQL Tools package versions under package.json matches yours.

  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions