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