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

valueChanges does not trigger anymore after fetching the same object type from another, separate query #11995

Open
fdruga opened this issue Aug 8, 2024 · 2 comments

Comments

@fdruga
Copy link

fdruga commented Aug 8, 2024

Issue Description

Hi,

We have a problem currently in our project - valueChanges does not trigger anymore when we fetch the same object type in another query.

The first query is as follows:

query GetBreadInfo {
  bread {
    uid
    name
  }
}

After some time we make another query on another object, but in the subfields we can also get the Bread, like this:

query GetRestaurantInfo {
  restaurant {
    uid
    name
    food {
        uid
        name
    }
  }
}

In the "food" subquery we receive objects of type Bread.

At this step we want to fetch the rest of the bread (initially we only took 5) and we try a manual fetchMore() on the initial queryRef.
When fetching again on the first query, the valueChanges does not trigger anymore without reinitializing the whole subscription.

  • On the network I can observe that the new data about the bread is present.
  • The merge function merges.
  • Cache is updated with new items of type bread. But valueChanges stays silent.
  • No duplicate values are present in cache
  • Debugging i found out that the initial queryRef is still alive and well.

Thank you for any kind of suggestion or advice about this!

Link to Reproduction

no reproduction :(

Reproduction Steps

Steps included in main message.

@apollo/client version

3.9.11

@alessbell
Copy link
Contributor

Hi @fdruga 👋

valueChanges does not trigger anymore

At which version(s) do you observe this change? Thanks for including the version of Apollo Client in your issue, but it looks like you're using apollo-angular and both valueChanges and queryRef are Apollo Angular APIs. If you have more info that points to a particular Apollo Client version that broke expected behavior, I'd be happy to look into it more. Thanks!

@alessbell alessbell added the 🏓 awaiting-contributor-response requires input from a contributor label Aug 8, 2024
@fdruga
Copy link
Author

fdruga commented Aug 13, 2024

The behavior is reproducing in all versions, starting from 3.7 to 3.11
We have a pretty antic version of apollo-angular in our app, 2.6.0.

Right now I'm trying to isolate the problem in an empty project in order to test out if upgrading apollo-angular solves the issue.

Thank you a lot for the fast response and the information!

@github-actions github-actions bot removed the 🏓 awaiting-contributor-response requires input from a contributor label Aug 14, 2024
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

No branches or pull requests

2 participants