-
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
Remove @nonreactive
directives from queries passed to MockLink
#11845
Conversation
🦋 Changeset detectedLatest commit: 1e48c56 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
size-limit report 📦
|
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
{ | ||
using spy = spyOnConsole("warn"); | ||
const stream = new ObservableStream(execute(link, { query })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit weird to me, because this would never be called like that in AC. Can you give me some insights into the intent here please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For these tests, I'm just trying to "prove" that the removal of the directives happen, so if we execute a query that matches the original (i.e. it still contains the directive), it won't match, hence this check.
What here is weird to you? Are you referring to the execute
call here? Or something else?
Fixes #11781
When using queries with the
@nonreactive
directive, they don't match mocks inMockLink
since the client will strip these directives in core before it makes it to the link chain. This means there is a mismatch in the query string whenMockLink
tries to figure out which mock should be used.We are already stripping
@client
and@connection
directives inMockLink
, but@nonreactive
was missing. This change ensures we treat it the same way so that mocks can properly match.