diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cffe0321fc..0f5265a91e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### vNEXT - Allow `GraphQLRequestListener` callbacks in plugins to depend on `this`. [PR #2470](https://github.com/apollographql/apollo-server/pull/2470) +- `apollo-server-testing`: Add `variables` and `operationName` to `Query` and `Mutation` types. [PR #2307](https://github.com/apollographql/apollo-server/pull/2307) [Issue #2172](https://github.com/apollographql/apollo-server/issue/2172) - `apollo-datasource-rest`: Correctly allow a TTL value of `0` to represent "not-cacheable". [PR #2588](https://github.com/apollographql/apollo-server/pull/2588) - `apollo-datasource-rest`: Fix `Invalid argument` in IE11, when `this.headers` is `undefined`. [PR #2607](https://github.com/apollographql/apollo-server/pull/2607) diff --git a/packages/apollo-server-testing/CHANGELOG.md b/packages/apollo-server-testing/CHANGELOG.md index a64c146b38f..d1c2295b906 100644 --- a/packages/apollo-server-testing/CHANGELOG.md +++ b/packages/apollo-server-testing/CHANGELOG.md @@ -2,4 +2,5 @@ ### vNEXT -* `apollo-server-testing`: Added createTestClient function +* `apollo-server-testing`: Add `variables` and `operationName` prop to `Query` and `Mutation` types. [PR #2307](https://github.com/apollographql/apollo-server/pull/2307) [Issue #2172](https://github.com/apollographql/apollo-server/issue/2172) +* `apollo-server-testing`: Added `createTestClient` function. diff --git a/packages/apollo-server-testing/src/createTestClient.ts b/packages/apollo-server-testing/src/createTestClient.ts index 9a4c78ad907..616f7f66f42 100644 --- a/packages/apollo-server-testing/src/createTestClient.ts +++ b/packages/apollo-server-testing/src/createTestClient.ts @@ -4,8 +4,22 @@ import { print, DocumentNode } from 'graphql'; type StringOrAst = string | DocumentNode; // A query must not come with a mutation (and vice versa). -type Query = { query: StringOrAst; mutation?: undefined }; -type Mutation = { mutation: StringOrAst; query?: undefined }; +type Query = { + query: StringOrAst; + mutation?: undefined; + variables?: { + [name: string]: any; + }; + operationName?: string; +}; +type Mutation = { + mutation: StringOrAst; + query?: undefined; + variables?: { + [name: string]: any; + }; + operationName?: string; +}; export default (server: ApolloServerBase) => { const executeOperation = server.executeOperation.bind(server);