We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is your feature request related to a problem? Please describe. Apollo for React has https://www.apollographql.com/docs/react/development-testing/testing/, which implements a MockLink in here: https://github.com/apollographql/apollo-client/blob/master/src/utilities/testing/mocking/MockedProvider.tsx (this is the link to the apollo v3 version, but it's similar for v2)
Adding that unfortunately doesn't work nicely since it has a dependency on React.
Describe the solution you'd like
I'd like to add an "official" MockLink in vue-apollo, or a way to create a testing client which you can use.
Something like import { createMockClient } from '@vue/apollo-testing' would be ideal.
import { createMockClient } from '@vue/apollo-testing'
Describe alternatives you've considered I've copied the code from MockLink into an own package so it doesn't depend on React, which works well internally at @sumcumo. Additionally, there is also https://github.com/Mike-Gibson/mock-apollo-client/, which works in a different way than the MockLink. Suggesting stubbing apollo in tests is in my opinion a bad practise, see https://kentcdodds.com/blog/stop-mocking-fetch
This applies for both, v3 and v4.
I'm happy to work on it to provide a PR for both, v3 and v4, as well, if you think that it would belong to this library.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
Apollo for React has https://www.apollographql.com/docs/react/development-testing/testing/, which implements a MockLink in here: https://github.com/apollographql/apollo-client/blob/master/src/utilities/testing/mocking/MockedProvider.tsx (this is the link to the apollo v3 version, but it's similar for v2)
Adding that unfortunately doesn't work nicely since it has a dependency on React.
Describe the solution you'd like
I'd like to add an "official" MockLink in vue-apollo, or a way to create a testing client which you can use.
Something like
import { createMockClient } from '@vue/apollo-testing'
would be ideal.Describe alternatives you've considered
I've copied the code from MockLink into an own package so it doesn't depend on React, which works well internally at @sumcumo. Additionally, there is also https://github.com/Mike-Gibson/mock-apollo-client/, which works in a different way than the MockLink.
Suggesting stubbing apollo in tests is in my opinion a bad practise, see https://kentcdodds.com/blog/stop-mocking-fetch
This applies for both, v3 and v4.
I'm happy to work on it to provide a PR for both, v3 and v4, as well, if you think that it would belong to this library.
The text was updated successfully, but these errors were encountered: