Skip to content
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

Add way of removing mock functions from schema #233

Open
roninjin10 opened this issue Jun 16, 2020 · 0 comments
Open

Add way of removing mock functions from schema #233

roninjin10 opened this issue Jun 16, 2020 · 0 comments
Labels
project-apollo-client (legacy) LEGACY TAG DO NOT USE 🧪 testing Feature requests related to testing

Comments

@roninjin10
Copy link

When using executable schema, instantiating a new Apollo client can be slow. To speed it up it would be helpful to be able to be able to do the reverse of addMockFunctionsToSchema and remove the mocks in between tests.

For our tests we use buildClientSchema and makeExecutableSchema to mock out our entire graphql schema automatically based on type. Then we provide only the mocks relavent to the test with addMockFunctionsToSchema. This way of mocking is extremely convenient but is very slow because of needing to instantiate a new executable schema in every test. I attempted to add a removeMocksFromSchema myself but this turned out to be very difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project-apollo-client (legacy) LEGACY TAG DO NOT USE 🧪 testing Feature requests related to testing
Projects
None yet
Development

No branches or pull requests

3 participants