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

includeUnusedVariables support for BatchHTTPLink #8824

Closed
ShawnToubeau opened this issue Sep 22, 2021 · 2 comments · Fixed by #10754
Closed

includeUnusedVariables support for BatchHTTPLink #8824

ShawnToubeau opened this issue Sep 22, 2021 · 2 comments · Fixed by #10754
Labels
🔗 apollo-link 🏓 awaiting-team-response requires input from the apollo team

Comments

@ShawnToubeau
Copy link

Intended outcome:
Hello there! I was noticing a bug in my team's application when we recently made the change from using HTTPLink to BatchHTTPLink and some of our queries started to fail because of unused variables.
We've tried setting includeUnusedVariables in our BatchHTTPLink constructor but that had no effect. When looking through the batchHttpLink.ts code I noticed that the variable requestOptions didn't inherit includeUnusedVariables from fetchParams, which is eventually passed to linkConfig.options.

Actual outcome:
BatchHTTPLink should strip unused variables by default just like HTTPLink and have the option of disabling it. See second bullet point here in the 3.3.0 change-log for details on behavior.

How to reproduce the issue:
With any Apollo Client implementation, swap out HTTPLink with BatchHTTPLink. Then, with any query/mutation, pass it extra variables and there should be an error thrown when unused variables are provided.

Versions
System:
OS: macOS 11.5.2
Binaries:
Node: 16.6.2 - /usr/local/bin/node
Yarn: 1.22.5 - ~/.yarn/bin/yarn
npm: 7.20.3 - /usr/local/bin/npm
Browsers:
Chrome: 93.0.4577.82
Firefox: 92.0
Safari: 14.1.2
npmPackages:
@apollo/client: 3.3.19 => 3.4.13
apollo-link-sentry: 3.0.2 => 3.0.2

@jerelmiller
Copy link
Member

Hello 👋

This has been fixed with #10754 and will go out with the next 3.8.0-alpha.x release. Thanks for reporting this!

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
For general questions, we recommend using StackOverflow or our discord server.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🔗 apollo-link 🏓 awaiting-team-response requires input from the apollo team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants