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 issue here source directive was not getting mapped to the correct types after multiple transformations #7790

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

uzair-inamdar
Copy link
Contributor

@uzair-inamdar uzair-inamdar commented Oct 17, 2024

🚨 IMPORTANT: Please do not create a Pull Request without creating an issue first.

Any change needs to be discussed before proceeding. Failure to do so may result in the rejection of
the pull request.

Description

The @source directives are added to the schema before schema transformations. Hence, need to be remapped after possible renames, replacements, and type merging. This was not happening with the existing code causing the @source directives to point to type names that either no longer existed (due to rename merges) or were pointing to the wrong type (type replacement transforms).

This fix introduces changes to the field mapper that happens after transformations, and make sure to map the @source directives to the correct or existing types.

Fixes #7771

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Screenshots/Sandbox (if appropriate/relevant):

Adding links to sandbox or providing screenshots can help us understand more about this PR and take
action on it as appropriate

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can
reproduce. Please also list any relevant details for your test configuration

  • [ x] Ran the solution on local machine to verify it fixed issues where issues were manifesting themselves before.

Test Environment:

  • OS: MacOS Sonoma
  • @graphql-mesh/1.1.0:
  • NodeJS: 20.12

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 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, and I have added a
    changeset using yarn changeset that bumps the version
  • New and existing unit tests and linter rules pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

… types after multiple transformations were applied
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.

@source directive does not reflect correct type after transforms are applied causing Hive to fail
1 participant