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

Attempt fixing nested variable forwarding in Fusion #6119

Merged
merged 7 commits into from
Jun 5, 2023

Conversation

martindisch
Copy link
Contributor

@martindisch martindisch commented May 5, 2023

With a query containing nested fields with arguments such as

query ProductReviews(
  $id: ID!
  $first: Int
) {
  node(id: $id) {
    ... on Product {
      id
      reviews(first: $first) {
        body
      }
    }
  }
}

the variables going to the nested fields (in this case $first) don't get forwarded to the subgraph, because while resolving the requirements the request formatter only considers the variables of the top-level field of the current selection (node), not those of its children.
The gateway returns the error "The following variables were not declared: first." originating from the subgraph missing its variable.

This can be "fixed" by the change in this PR, although it's definitely not a sensible solution. Do you have any ideas as to the proper way of dealing with that?

@martindisch martindisch changed the title Attempt fixing nested variable forwarding Attempt fixing nested variable forwarding in Fusion May 5, 2023
@michaelstaib michaelstaib self-requested a review May 5, 2023 17:29
@michaelstaib
Copy link
Member

This fix is not the solution ... I am working on a proper fix at the moment ...

@martindisch
Copy link
Contributor Author

Excellent, that's what we've been hoping for! Feel free to close this once you have something.

@michaelstaib
Copy link
Member

I have found a couple more cases that were not working ... like nested variables and so on. We will ship the fix with 13.2.1 today.

@michaelstaib
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@michaelstaib
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@michaelstaib
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@michaelstaib michaelstaib merged commit 33b95e7 into ChilliCream:main Jun 5, 2023
@sonarcloud
Copy link

sonarcloud bot commented Jun 5, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

0.0% 0.0% Coverage
11.3% 11.3% Duplication

@martindisch
Copy link
Contributor Author

Great stuff, thanks for the proper fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants