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(grpc): Update GrpcLoaderHelper to use rootId for root json naming #8201

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

iamchanii
Copy link
Contributor

@iamchanii iamchanii commented Dec 28, 2024

Description

This pull request changes the logic of the getDescriptorSets method of the GrpcLoaderHelper class.

Previously, if the Protobuf Root did not have a name, it utilized an index to determine the name. This could cause the GrpcTransportHelper to select the wrong grpcRootJson directory when there was more than one gRPC Subgraph with an unnamed Protobuf Root.

So I put a variable called rootId in the module with the GrpcLoaderHelper class, and changed it to use that variable to determine the name instead of the index.

Related #7962

Type of change

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

Screenshots/Sandbox (if appropriate/relevant):

N/A

How Has This Been Tested?

I have confirmed that the issue is fixed with a patch in the issue reproduction branch that reflects the changes in this pull request.

As mentioned in #7962 (comment), To fix the issue, it needs to be changed to allow passing directives when calling mergeDirectives.

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

Further comments

N/A

@iamchanii iamchanii marked this pull request as ready for review December 28, 2024 11:47
@ardatan
Copy link
Owner

ardatan commented Dec 29, 2024

Thanks for the PR 🙏
We appreciate your feedback and effort.
The issue was not the naming since each subgraph is handled seperately so having a global Root counter might cause inconsistent naming based on the order of the subgraphs in the composition configuration.
And this wasn't fixing the issue at all.
So I created this PR to fix the issue.

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.

2 participants