Closed davidcolatti closed 4 years ago
Hi, Is this with version 0.x (Apollo 2) or 1.x (Apollo 3) of mock Apollo client?
The behaviour of client side directives and how they are passed down to a link changed between Apollo client 2 and 3 which means mock Apollo client support is different between the two versions.
Yes, this is for Apollo 3..
I just resolved my issue thought looking at your tests. :)
I had a full client directive query and I resolved it using the resolver.
Ah, great news. Glad you've got it working.
Maybe I'll add a bit to the readme outlining how it works, as it's come up a few times now.
That would definitely be helpful! Thanks for your work though! Way better than the Apollo MockedProvider..
For folks coming here from Google, this is the line that helped me.
You can pass either resolvers or cache typePolicies
to createMockClient
to tell the client to use these your mocks.
The documentation isn't very clear about this and I've been attempting this for a while.