-
Notifications
You must be signed in to change notification settings - Fork 786
Improve mismatched query error message #2883
base: master
Are you sure you want to change the base?
Improve mismatched query error message #2883
Conversation
@moretti: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
595c2ce
to
158b428
Compare
Thanks for this PR @moretti. We're a bit sensitive to bundle sizes, so adding new external |
@hwillson thank you for your feedback. I switched from // the following imports *should* be equivalent, in terms of bundle size:
import func from 'lodash/func';
import func from 'lodash.func'; To be honest, the only reason why I did that is because I got a TypeScript error when using react-apollo/src/test-links.ts Lines 81 to 87 in 158b428
possibly because the TypeScript compiler is configured to use es5 rather than es2015+ I'll see if I can find a smaller alternative to |
Now that (I realise this has been added to the 3.1 milestone, so this might not be a new point 🙂) |
@hwillson Bundle size seems good now - what needs fixing for this to make it to the master branch? |
I think that the bundle size was never a problem, even in v2 import { MockedProvider, MockLink } from 'react-apollo/test-utils'; so they won't affect the size of the production bundle (the same concept applies, for example, to I can fix the conflicts and reapply the same changes to |
That would be awesome @moretti - this legit would've saved me hours of on-the-Caltrain debugging. |
What is the status of this, do you need some help? This could help a lot of people |
This fix would be a huge addition for anyone using Apollo Client 2, I certainly hope it is in some way ported into Apollo Client 3. Right now, I am attempting to port this into https://github.com/apollographql/react-apollo/blob/v2.5.8/packages/testing/src/mocks/mockLink.ts I am doing a fair amount of mocking and this is a huge huge need so thanks a lot for considering this. It goes all long ways for writing more testable apps w/ Apollo Client and saving hours of headache. |
Any news? This would be really useful |
This would be really useful for me too. It's going to be so hard to debug failing tests without this :/ |
What's the status on this? Would solve by far the biggest pain working with |
for anyone out there needing a temp solution for Apollo 2.x, I have forked
Commit: |
Checklist:
This PR improves the error message generated by
MockLink
/MockedProvider
when a query or mutation does not match with any of the mocked requests.For example, the following mock:
when called with a different query:
will print the following error:
so that it's easy to understand that we passed an extra field (
id
in this case)