useQuery requests omitted properties from previous variables (Working 3.5.10 but breaking in 3.6.1/2)
See original GitHub issueIntended outcome:
const [variables, setVariables] = useState({deleted: true, someOther: "value"})
const { data } = useQuery(query, { variables })
// Omit the deleted property
const breakIng = () => setVariables({someOther: "value"}
If the variable omits a property that was queried before, then the old value of that variable is used in the request.
Actual outcome: The request must transfer the variables as is.
How to reproduce the issue: See above, hope it helps you.
Versions 3.5.10: works as expected 3.6.1 and 3.6.2: requests previous properties
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top Results From Across the Web
The useQuery hook - with variables | Lift-off III - Apollo GraphQL
The useQuery hook returns an object with three useful properties that we use in our app: indicates whether the query has completed and...
Read more >Nebula Graph Database Manual
Graphs are one of the main areas of research in computer science. Graphs can efficiently solve many of the problems that exist.
Read more >useQuery | TanStack Query Docs
By default, access to properties will be tracked, and the component will only re-render when one of the tracked properties change.
Read more >mongoose | Yarn - Package Manager
Mongoose. Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Mongoose supports Node.js and Deno (alpha).
Read more >History.md - andrew.cmu.ed
isEqual false negatives bug in js-bson #2070 * fixed; missing check for ... fixed versioning tests * benchmarks; updated for pull requests 3.7.2...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@benjamn Thanks, after
3.7.0-alpha.6
installing the issue is gone.@obo-spi @yura3d My proposed fix can be tested now by running
npm i @apollo/client@beta
to get version3.7.0-alpha.6
. Note: while that version says 3.7, PR #9741 is targeting themain
branch, implying a 3.6.x patch release (not 3.7). Please let us know if that alpha version seems to help (or not)!