-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[v3.4] Unexpected Console Warning: "Missing cache result fields" #8442
Comments
Thanks for flagging this change in behavior @dylanwulf! This appears to be a consequence of this change from #7761, specifically the addition of the apollo-client/src/core/QueryManager.ts Lines 1420 to 1427 in edab367
Since your reproduction is explicitly requesting |
@benjamn ah ok I see. In that case, why doesn't the warning show up when I use |
Ok, I guess this issue being closed means that it's expected for this console warning to happen with |
@dylanwulf My hunch is that |
As for the preemptive closing of the issue (sorry!), we're doing some general cleanup before the v3.4 release, and we think these warnings are expected/harmless, though you're right that they are new in v3.4. We can continue to iterate on warning noise after v3.4 is released, unless you think there's a deeper problem hiding here? |
@benjamn ok I understand thank you! It just seemed strange to me that it was triggering for |
I'm experiencing these as well since I switched to rc15/18. I'm getting a lot of them, systematically. However they are triggered by the exact same request in my case, requesting the exact same fields. Only the variable changes. Can I humbly request a flag to lower the verbosity? With the associated stack trace, these are taking over my browser console output. Below are 3 such requests, which were performed in a row. Apologies, I don't know how to format the request payload seen in the Chrome's network tab, I'll be copy/pasting.
The only part that changes here are the variables: Each time I press the "Previous week" button, a request for that week's date interval is made, and each time I'm getting:
Note: the The thing is, the
then if they head to their projects page, we will request:
in their proposals page:
etc. The schema itself has many other "root" fields than Before performing these 3 requests in this specific example, one was made as soon as they authenticated, to get their name and profile picture, so I assume this filled the cache with the corresponding data first:
Am I possibly missing something with these new warnings/eerroors? This type of request on the Thanks |
Messages logged with invariant.debug will be hidden by default, but can be exposed by calling setVerbosity("debug"). This additional log-level flexibility should be useful for addressing apollographql/apollo-client#8442 (comment)
@sebastienbarre Thanks for the examples. I don't think you're doing anything wrong here. The warnings are just too noisy. The original goal of these warnings was to provide clues about why an unexpected network request happened, but in your case the network request seems to be very much expected/normal, so the warning is not helpful. As you might guess from the PR linked above, the current plan is to demote these |
@benjamn thanks for the quick solution, appreciated. I'll test it out when ready. |
@sebastienbarre Alright, these warnings should be hidden by default in |
@benjamn this did the trick, many thanks |
This should be resolved in @apollo/client@latest - let us know if not. |
Intended outcome:
Should not print warning to console when two separate queries request different subsets of the same field
Actual outcome:
Console warning is printed
How to reproduce the issue:
https://github.com/dylanwulf/react-apollo-error-template/tree/cache-miss-error (use branch cache-miss-error)
Instructions: Start app, open console, click any unselected radio button, see that a warning is printed to console.
Conditions necessary for issue to occur:
notifyOnNetworkStatusChange: true
fetchPolicy: 'cache-and-network'
3.4.0-beta.14
(possibly caused by Preserve no-cache fetchPolicy with notifyOnNetworkStatusChange #7761?)Versions
The text was updated successfully, but these errors were encountered: