Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix replace resolver persistence #1525

Closed

Conversation

EmrysMyrddin
Copy link
Collaborator

Description

This PR aims to fix the feature allowing to replace the resolver function in place just before it is called.

Since the onResolverCalled hook is being called on each resolver calls, it is expected that the replaceResolverFn function only applies to this resolver call. This PR implement this behaviour.

Fixes #1524

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
    • Since this is changing the behaviour of replaceResolverFn, it possible that it introduce some unexpected breaking changes if some relied on the persistent replacement.
  • This change requires a documentation update
    • Since this is an undocumented feature, there isn't any documentation update needed for now.

How Has This Been Tested?

I have added test cases to the test suite.

Test Environment:

  • OS: macOS 12.5.1
  • @envelop/core: 98840fd
  • NodeJS: 16.14.0

Checklist:

  • I have followed the CONTRIBUTING doc and the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@changeset-bot
Copy link

changeset-bot bot commented Sep 16, 2022

🦋 Changeset detected

Latest commit: b27e13e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@envelop/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Sep 16, 2022

@EmrysMyrddin is attempting to deploy a commit to the The Guild Team on Vercel.

A member of the Team first needs to authorize it.

@saihaj
Copy link
Collaborator

saihaj commented Oct 12, 2022

Thanks for the PR! while working on v3 we also fixed this issue :) cc @ardatan #1487

@saihaj saihaj closed this Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ReplaceResolverFn is replacing resolve is mutating field definition
2 participants