UNPKG

733 BMarkdownView Raw
1# apollo-server-testing
2
3This deprecated package contains a function `createTestClient` which is a very thin wrapper around the Apollo Server `server.executeOperation` method.
4
5Code that uses this package looks like the following, where `server` is an `ApolloServer`:
6
7```js
8const { createTestClient } = require('apollo-server-testing');
9
10const { query, mutate } = createTestClient(server);
11
12await query({ query: QUERY });
13await mutate({ mutation: MUTATION });
14```
15
16We recommend you stop using this package and replace the above code with the equivalent:
17
18```js
19await server.executeOperation({ query: QUERY });
20await server.executeOperation({ query: MUTATION });
21```
22
23This package will not be distributed as part of Apollo Server 3.