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

Ignore option callbacks when deciding to update a query #6588

Merged
merged 4 commits into from
Jul 20, 2020
Merged

Commits on Jul 20, 2020

  1. Ignore option callbacks when deciding to update a query

    `QueryData` stores last used options to help decide when it should
    re-run. If new options (when compared against the previously
    stored last options) are found, `QueryData` will make sure the
    new options are passed into Apollo Client for processing.
    When `onCompleted` and/or `onError` options are set however,
    `QueryData` thinks the options received on each render are new
    as these callback functions don't have a stable identity. This
    can then lead to infinite re-renders.
    
    This commit adjusts the `QueryData` option equality check to
    ignore option callbacks. During normal use of `useQuery` it
    should be okay to ignore callbacks like this, as they don't
    normally change between renders.
    
    Fixes #6301
    hwillson authored and benjamn committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    c6da267 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e1f1eb7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6f009e2 View commit details
    Browse the repository at this point in the history
  4. Mention PR #6588 in CHANGELOG.md.

    benjamn committed Jul 20, 2020
    Configuration menu
    Copy the full SHA
    462e6a5 View commit details
    Browse the repository at this point in the history