diff --git a/README.md b/README.md index 4006ba4..b5a81ee 100644 --- a/README.md +++ b/README.md @@ -41,10 +41,9 @@ const UPDATE_USER = ` } `; -const mutationResult = await mutate( - UPDATE_USER, - { variables: { id: 1, email: 'nancy@foo.co' } } -); +const mutationResult = await mutate(UPDATE_USER, { + variables: { id: 1, email: 'nancy@foo.co' } +}); expect(mutationResult).toEqual({ data: { @@ -85,6 +84,34 @@ This is useful when your apollo server `context` option is a callback that opera As mentioned above, if you don't pass an `extendMockRequest` to `createTestClient`, we provide a default request mock object for you. See https://github.com/howardabrams/node-mocks-http#createrequest for all the default values that are included in that mock. +### setOptions + +You can also set the `request` and `response` mocking options **after** the creation of the `test client`, which is a **cleaner** and **faster** way due not needing to create a new instance for **any** change you might want to do the `request` or `response`. + +```js +const { query, setOptions } = createTestClient({ + apolloServer +}); + +setOptions({ + // If "request" or "response" is not specified, it's not modified + request: { + headers: { + cookie: 'csrf=blablabla', + referer: '' + } + }, + response: { + locals: { + user: { + isAuthenticated: false + } + } + } +}); +``` + + ## Why not use `apollo-server-testing`? You can't really write _real_ integration tests with `apollo-server-testing`, because it doesn't support servers which rely on the `context` option being a function that uses the `req` object ([see this issue for more information](https://github.com/apollographql/apollo-server/issues/2277)). diff --git a/package.json b/package.json index 19f5e5e..bfe779f 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,13 @@ "dev": "tsc --watch" }, "dependencies": { - "apollo-server-core": "^2.8.1", - "apollo-server-express": "^2.8.1", + "apollo-server-core": "^2.9.13", + "apollo-server-express": "^2.9.13", "express": "^4.17.1", - "node-mocks-http": "^1.7.6", - "typescript": "^3.5.3" + "node-mocks-http": "^1.8.0" + }, + "devDependencies": { + "typescript": "^3.7.3" }, "peerDependencies": { "graphql": "^0.12.0 || ^0.13.0 || ^14.0.0" diff --git a/src/index.ts b/src/index.ts index 6230ef5..bd4b5ef 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,25 +1,24 @@ // @flow -import express from 'express'; -import httpMocks from 'node-mocks-http'; -import { print } from 'graphql'; import { convertNodeHttpToRequest, runHttpQuery } from 'apollo-server-core'; - import { ApolloServer } from 'apollo-server-express'; -import { DocumentNode } from 'graphql'; +import express from 'express'; +import { DocumentNode, print } from 'graphql'; +import httpMocks, { RequestOptions, ResponseOptions } from 'node-mocks-http'; -const mockRequest = (options = {}) => +const mockRequest = (options: RequestOptions = {}) => httpMocks.createRequest({ method: 'POST', ...options }); -const mockResponse = (options = {}) => httpMocks.createResponse(options); +const mockResponse = (options: ResponseOptions = {}) => + httpMocks.createResponse(options); -type StringOrAst = string | DocumentNode; -type Options = { variables?: object}; +export type StringOrAst = string | DocumentNode; +export type Options = { variables?: T }; -type TestClientConfig = { +export type TestClientConfig = { // The ApolloServer instance that will be used for handling the queries you run in your tests. // Must be an instance of the ApolloServer class from `apollo-server-express` (or a compatible subclass). apolloServer: ApolloServer; @@ -28,15 +27,25 @@ type TestClientConfig = { // and you want to inject data into that `req` object. // If you don't pass anything here, we provide a default request mock object for you. // See https://github.com/howardabrams/node-mocks-http#createrequest for all the default values that are included. - extendMockRequest?: {}; + extendMockRequest?: RequestOptions; // Extends the mocked Response object with additional keys. // Useful when your apolloServer `context` option is a callback that operates on the passed in `res` key, // and you want to inject data into that `res` object (such as `res.locals`). // If you don't pass anything here, we provide a default response mock object for you. // See https://www.npmjs.com/package/node-mocks-http#createresponse for all the default values that are included. - extendMockResponse?: {}; + extendMockResponse?: ResponseOptions; }; +export type TestQuery = ( + operation: StringOrAst, + { variables }?: Options +) => Promise; + +export type TestSetOptions = (options: { + request?: RequestOptions; + response?: ResponseOptions; +}) => void; + // This function takes in an apollo server instance and returns a function that you can use to run operations // against your schema, and assert on the results. // @@ -59,17 +68,43 @@ type TestClientConfig = { // } // }); // ``` -export const createTestClient = ({ +export function createTestClient({ apolloServer, extendMockRequest = {}, extendMockResponse = {} -}: TestClientConfig) => { +}: TestClientConfig) { const app = express(); apolloServer.applyMiddleware({ app }); - const test = async (operation: StringOrAst, {variables}: Options = {}) => { - const req = mockRequest(extendMockRequest); - const res = mockResponse(extendMockResponse); + let mockRequestOptions = extendMockRequest; + let mockResponseOptions = extendMockResponse; + + /** + * Set the options after TestClient creation + * Useful when you don't want to create a new instance just for a specific change in the request or response. + * */ + + const setOptions: TestSetOptions = ({ + request, + response + }: { + request?: RequestOptions; + response?: ResponseOptions; + }) => { + if (request) { + mockRequestOptions = request; + } + if (response) { + mockResponseOptions = response; + } + }; + + const test: TestQuery = async ( + operation: StringOrAst, + { variables }: Options = {} + ) => { + const req = mockRequest(mockRequestOptions); + const res = mockResponse(mockResponseOptions); const graphQLOptions = await apolloServer.createGraphQLServerOptions( req, @@ -87,11 +122,12 @@ export const createTestClient = ({ request: convertNodeHttpToRequest(req) }); - return JSON.parse(graphqlResponse); + return JSON.parse(graphqlResponse) as T; }; return { query: test, - mutate: test + mutate: test, + setOptions }; -}; +} diff --git a/yarn.lock b/yarn.lock index 825b5b7..1618b81 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,25 @@ # yarn lockfile v1 +"@apollo/protobufjs@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@apollo/protobufjs/-/protobufjs-1.0.3.tgz#02c655aedd4ba7c7f64cbc3d2b1dd9a000a391ba" + integrity sha512-gqeT810Ect9WIqsrgfUvr+ljSB5m1PyBae9HGdrRyQ3HjHjTcjVvxpsMYXlUk4rUHnrfUqyoGvLSy2yLlRGEOw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.0" + "@types/node" "^10.1.0" + long "^4.0.0" + "@apollographql/apollo-tools@^0.4.0": version "0.4.0" resolved "https://registry.yarnpkg.com/@apollographql/apollo-tools/-/apollo-tools-0.4.0.tgz#8a1a0ab7a0bb12ccc03b72e4a104cfa5d969fd5f" @@ -74,7 +93,7 @@ dependencies: "@types/node" "*" -"@types/body-parser@*", "@types/body-parser@1.17.0": +"@types/body-parser@*": version "1.17.0" resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.17.0.tgz#9f5c9d9bd04bb54be32d5eb9fc0d8c974e6cf58c" integrity sha512-a2+YeUjPkztKJu5aIF2yArYFQQp8d51wZ7DavSHjFuY1mqVgidGyzEQ41JIVNy82fXj8yPgy2vJmfIywgESW6w== @@ -82,6 +101,14 @@ "@types/connect" "*" "@types/node" "*" +"@types/body-parser@1.17.1": + version "1.17.1" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.17.1.tgz#18fcf61768fb5c30ccc508c21d6fd2e8b3bf7897" + integrity sha512-RoX2EZjMiFMjZh9lmYrwgoP9RTpAjSHiJxdp4oidAQVO02T7HER3xj9UKue5534ULWeqVEkujhWcyvUce+d68w== + dependencies: + "@types/connect" "*" + "@types/node" "*" + "@types/connect@*": version "3.4.32" resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.32.tgz#aa0e9616b9435ccad02bc52b5b454ffc2c70ba28" @@ -114,7 +141,7 @@ "@types/node" "*" "@types/range-parser" "*" -"@types/express@*", "@types/express@4.17.0": +"@types/express@*": version "4.17.0" resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.0.tgz#49eaedb209582a86f12ed9b725160f12d04ef287" integrity sha512-CjaMu57cjgjuZbh9DpkloeGxV45CnMGlVd+XpG7Gm9QgVrd7KFq+X4HY0vM+2v0bczS48Wg7bvnMY5TN+Xmcfw== @@ -123,6 +150,15 @@ "@types/express-serve-static-core" "*" "@types/serve-static" "*" +"@types/express@4.17.1": + version "4.17.1" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.1.tgz#4cf7849ae3b47125a567dfee18bfca4254b88c5c" + integrity sha512-VfH/XCP0QbQk5B5puLqTLEeFgR8lfCJHZJKkInZ9mkYd+u8byX0kztXEQxEk4wZXJs8HI+7km2ALXjn4YKcX9w== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "*" + "@types/serve-static" "*" + "@types/graphql-upload@^8.0.0": version "8.0.0" resolved "https://registry.yarnpkg.com/@types/graphql-upload/-/graphql-upload-8.0.0.tgz#cf1a464e1ad3d185d6e1d77b5df0ca26057a572c" @@ -221,41 +257,41 @@ accepts@^1.3.5, accepts@^1.3.7, accepts@~1.3.7: mime-types "~2.1.24" negotiator "0.6.2" -apollo-cache-control@0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/apollo-cache-control/-/apollo-cache-control-0.8.1.tgz#707c0b958c02c5b47ddf49a02f60ea88a64783fb" - integrity sha512-yQy5KB/OuX90PsdztWc4vfc4R//ZmW/AxNgXKWga0xW5OzEsysdJWHAsTzb40/rkJ9VNeQ+0N5wGikiS+jSCzg== +apollo-cache-control@^0.8.8: + version "0.8.8" + resolved "https://registry.yarnpkg.com/apollo-cache-control/-/apollo-cache-control-0.8.8.tgz#c6de9ef3a154560f6cf26ce7159e62438c1ac022" + integrity sha512-hpIJg3Tmb6quA111lrVO+d3qcyYRlJ8JqbeQdcgwLT3fb2VQzk21SrBZYl2oMM4ZqSOWCZWg4/Cn9ARYqdWjKA== dependencies: - apollo-server-env "2.4.1" - graphql-extensions "0.8.1" + apollo-server-env "^2.4.3" + graphql-extensions "^0.10.7" -apollo-datasource@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/apollo-datasource/-/apollo-datasource-0.6.1.tgz#697870f564da90bee53fa30d07875cb46c4d6b06" - integrity sha512-oy7c+9Up8PSZwJ1qTK9Idh1acDpIocvw+C0zcHg14ycvNz7qWHSwLUSaAjuQMd9SYFzB3sxfyEhyfyhIogT2+Q== +apollo-datasource@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/apollo-datasource/-/apollo-datasource-0.6.3.tgz#b31e089e52adb92fabb536ab8501c502573ffe13" + integrity sha512-gRYyFVpJgHE2hhS+VxMeOerxXQ/QYxWG7T6QddfugJWYAG9DRCl65e2b7txcGq2NP3r+O1iCm4GNwhRBDJbd8A== dependencies: - apollo-server-caching "0.5.0" - apollo-server-env "2.4.1" + apollo-server-caching "^0.5.0" + apollo-server-env "^2.4.3" -apollo-engine-reporting-protobuf@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/apollo-engine-reporting-protobuf/-/apollo-engine-reporting-protobuf-0.4.0.tgz#e34c192d86493b33a73181fd6be75721559111ec" - integrity sha512-cXHZSienkis8v4RhqB3YG3DkaksqLpcxApRLTpRMs7IXNozgV7CUPYGFyFBEra1ZFgUyHXx4G9MpelV+n2cCfA== +apollo-engine-reporting-protobuf@^0.4.4: + version "0.4.4" + resolved "https://registry.yarnpkg.com/apollo-engine-reporting-protobuf/-/apollo-engine-reporting-protobuf-0.4.4.tgz#73a064f8c9f2d6605192d1673729c66ec47d9cb7" + integrity sha512-SGrIkUR7Q/VjU8YG98xcvo340C4DaNUhg/TXOtGsMlfiJDzHwVau/Bv6zifAzBafp2lj0XND6Daj5kyT/eSI/w== dependencies: - protobufjs "^6.8.6" + "@apollo/protobufjs" "^1.0.3" -apollo-engine-reporting@1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/apollo-engine-reporting/-/apollo-engine-reporting-1.4.3.tgz#0fcb67de7a24bef4e7e59990981f923267ffdd00" - integrity sha512-xv27qfc9dhi1yaWOhNQRmfF+SoLy74hl+M42arpIWdkoDe22fVTmTIqxqGwo4TFR3Z2OkAV5tNzuuOI/icd0Rg== +apollo-engine-reporting@^1.4.11: + version "1.4.11" + resolved "https://registry.yarnpkg.com/apollo-engine-reporting/-/apollo-engine-reporting-1.4.11.tgz#ea4501925c201e62729a11ce36284a89f1eaa4f5" + integrity sha512-7ZkbOGvPfWppN8+1KHzyHPrJTMOmrMUy38unao2c9TTToOAnEvx2MtUTo6mr3aw/g8UQYUf0x2Cq+K2YSlUTPw== dependencies: - apollo-engine-reporting-protobuf "0.4.0" - apollo-graphql "^0.3.3" - apollo-server-caching "0.5.0" - apollo-server-env "2.4.1" - apollo-server-types "0.2.1" + apollo-engine-reporting-protobuf "^0.4.4" + apollo-graphql "^0.3.4" + apollo-server-caching "^0.5.0" + apollo-server-env "^2.4.3" + apollo-server-types "^0.2.8" async-retry "^1.2.1" - graphql-extensions "0.9.1" + graphql-extensions "^0.10.7" apollo-env@0.5.1: version "0.5.1" @@ -266,12 +302,21 @@ apollo-env@0.5.1: node-fetch "^2.2.0" sha.js "^2.4.11" -apollo-graphql@^0.3.3: - version "0.3.3" - resolved "https://registry.yarnpkg.com/apollo-graphql/-/apollo-graphql-0.3.3.tgz#ce1df194f6e547ad3ce1e35b42f9c211766e1658" - integrity sha512-t3CO/xIDVsCG2qOvx2MEbuu4b/6LzQjcBBwiVnxclmmFyAxYCIe7rpPlnLHSq7HyOMlCWDMozjoeWfdqYSaLqQ== +apollo-env@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/apollo-env/-/apollo-env-0.6.0.tgz#124c2ab6bac0a9c6761aa7c1f036964fd282b3ac" + integrity sha512-DttHOpLISRej8STjbXjQCXq3YeE2pATaC4UEd2YE7TjjYhQmp9yxohlkHfSR78BvPzczhyDs6WQQEzasHv0M0A== dependencies: - apollo-env "0.5.1" + core-js "^3.0.1" + node-fetch "^2.2.0" + sha.js "^2.4.11" + +apollo-graphql@^0.3.4: + version "0.3.5" + resolved "https://registry.yarnpkg.com/apollo-graphql/-/apollo-graphql-0.3.5.tgz#9d6b30ba94958947e0ad5e67ac0a8a856f1a636d" + integrity sha512-X2N/LREJSAkI0RhMEJ6d0kGjdJSI4SFyf6soLvLLTQn0Bhi/52hMLf8k4kO5t0SCKuWc1+Pw/tdCniK4Gc1IdA== + dependencies: + apollo-env "^0.6.0" lodash.sortby "^4.7.0" apollo-link@^1.2.3: @@ -284,33 +329,33 @@ apollo-link@^1.2.3: tslib "^1.9.3" zen-observable-ts "^0.8.19" -apollo-server-caching@0.5.0: +apollo-server-caching@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/apollo-server-caching/-/apollo-server-caching-0.5.0.tgz#446a37ce2d4e24c81833e276638330a634f7bd46" integrity sha512-l7ieNCGxUaUAVAAp600HjbUJxVaxjJygtPV0tPTe1Q3HkPy6LEWoY6mNHV7T268g1hxtPTxcdRu7WLsJrg7ufw== dependencies: lru-cache "^5.0.0" -apollo-server-core@2.8.1, apollo-server-core@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.8.1.tgz#e5fadb3fe1fadd009d1b06a46cb44ec8692bf3fb" - integrity sha512-BpvhKdycTI1v5n8biJ5c/DVF7MCbTL3JtB9llHGkqYgHaTH1gXguh2qD8Vcki+rpUNO5P1lcj5V6oVXoSUFXlA== +apollo-server-core@^2.9.13: + version "2.9.13" + resolved "https://registry.yarnpkg.com/apollo-server-core/-/apollo-server-core-2.9.13.tgz#29fee69be56d30605b0a06cd755fd39e0409915f" + integrity sha512-iXTGNCtouB0Xe37ySovuZO69NBYOByJlZfUc87gj0pdcz0WbdfUp7qUtNzy3onp63Zo60TFkHWhGNcBJYFluzw== dependencies: "@apollographql/apollo-tools" "^0.4.0" "@apollographql/graphql-playground-html" "1.6.24" "@types/graphql-upload" "^8.0.0" "@types/ws" "^6.0.0" - apollo-cache-control "0.8.1" - apollo-datasource "0.6.1" - apollo-engine-reporting "1.4.3" - apollo-server-caching "0.5.0" - apollo-server-env "2.4.1" - apollo-server-errors "2.3.1" - apollo-server-plugin-base "0.6.1" - apollo-server-types "0.2.1" - apollo-tracing "0.8.1" + apollo-cache-control "^0.8.8" + apollo-datasource "^0.6.3" + apollo-engine-reporting "^1.4.11" + apollo-server-caching "^0.5.0" + apollo-server-env "^2.4.3" + apollo-server-errors "^2.3.4" + apollo-server-plugin-base "^0.6.8" + apollo-server-types "^0.2.8" + apollo-tracing "^0.8.8" fast-json-stable-stringify "^2.0.0" - graphql-extensions "0.9.1" + graphql-extensions "^0.10.7" graphql-tag "^2.9.2" graphql-tools "^4.0.0" graphql-upload "^8.0.2" @@ -318,62 +363,64 @@ apollo-server-core@2.8.1, apollo-server-core@^2.8.1: subscriptions-transport-ws "^0.9.11" ws "^6.0.0" -apollo-server-env@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/apollo-server-env/-/apollo-server-env-2.4.1.tgz#58264ecfeb151919e0f480320b4e3769be9f18f3" - integrity sha512-J4G1Q6qyb7KjjqvQdVM5HUH3QDb52VK1Rv+MWL0rHcstJx9Fh/NK0sS+nujrMfKw57NVUs2d4KuYtl/EnW/txg== +apollo-server-env@^2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/apollo-server-env/-/apollo-server-env-2.4.3.tgz#9bceedaae07eafb96becdfd478f8d92617d825d2" + integrity sha512-23R5Xo9OMYX0iyTu2/qT0EUb+AULCBriA9w8HDfMoChB8M+lFClqUkYtaTTHDfp6eoARLW8kDBhPOBavsvKAjA== dependencies: node-fetch "^2.1.2" util.promisify "^1.0.0" -apollo-server-errors@2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/apollo-server-errors/-/apollo-server-errors-2.3.1.tgz#033cf331463ebb99a563f8354180b41ac6714eb6" - integrity sha512-errZvnh0vUQChecT7M4A/h94dnBSRL213dNxpM5ueMypaLYgnp4hiCTWIEaooo9E4yMGd1qA6WaNbLDG2+bjcg== +apollo-server-errors@^2.3.4: + version "2.3.4" + resolved "https://registry.yarnpkg.com/apollo-server-errors/-/apollo-server-errors-2.3.4.tgz#b70ef01322f616cbcd876f3e0168a1a86b82db34" + integrity sha512-Y0PKQvkrb2Kd18d1NPlHdSqmlr8TgqJ7JQcNIfhNDgdb45CnqZlxL1abuIRhr8tiw8OhVOcFxz2KyglBi8TKdA== -apollo-server-express@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/apollo-server-express/-/apollo-server-express-2.8.1.tgz#955708efdcae8201b7941f0b5c5895e76997b4a3" - integrity sha512-XoWqSuNQkL8ivBq5LXJW6wV0/Ef+m8w4fAK/7PBspLHVfDAbHRyRr6zraotim2Kl7NOnzcqHtb6sB9yozjL0hA== +apollo-server-express@^2.9.13: + version "2.9.13" + resolved "https://registry.yarnpkg.com/apollo-server-express/-/apollo-server-express-2.9.13.tgz#abb00bcf85d86a6e0e9105ce3b7fae9a7748156b" + integrity sha512-M306e07dpZ8YpZx4VBYa0FWlt+wopj4Bwn0Iy1iJ6VjaRyGx2HCUJvLpHZ+D0TIXtQ2nX3DTYeOouVaDDwJeqQ== dependencies: "@apollographql/graphql-playground-html" "1.6.24" "@types/accepts" "^1.3.5" - "@types/body-parser" "1.17.0" + "@types/body-parser" "1.17.1" "@types/cors" "^2.8.4" - "@types/express" "4.17.0" + "@types/express" "4.17.1" accepts "^1.3.5" - apollo-server-core "2.8.1" - apollo-server-types "0.2.1" + apollo-server-core "^2.9.13" + apollo-server-types "^0.2.8" body-parser "^1.18.3" cors "^2.8.4" + express "^4.17.1" graphql-subscriptions "^1.0.0" graphql-tools "^4.0.0" + parseurl "^1.3.2" subscriptions-transport-ws "^0.9.16" type-is "^1.6.16" -apollo-server-plugin-base@0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.6.1.tgz#b9c209aa2102a26c6134f51bfa1e4a8307b63b11" - integrity sha512-gLLF0kz4QOOyczDGWuR2ZNDfa1nHfyFNG76ue8Es0/0ujnMT9KoSokXkx1hDh0X7FFTMj/MelYYoNEqgTH88zw== +apollo-server-plugin-base@^0.6.8: + version "0.6.8" + resolved "https://registry.yarnpkg.com/apollo-server-plugin-base/-/apollo-server-plugin-base-0.6.8.tgz#94cb9a6d806b7057d1d42202292d2adcf2cf0e7a" + integrity sha512-0pKCjcg9gHBK8qlb280+N0jl99meixQtxXnMJFyIfD+45OpKQ+WolHIbO0oZgNEt7r/lNWwH8v3l5yYm1ghz1A== dependencies: - apollo-server-types "0.2.1" + apollo-server-types "^0.2.8" -apollo-server-types@0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/apollo-server-types/-/apollo-server-types-0.2.1.tgz#553da40ea1ad779ef0390c250ddad7eb782fdf64" - integrity sha512-ls26d6jjY7x91ctLWtbpQHGW0lcFR1LcOpDvBQUC2aCwQzuW/6yV7F3hfcEdLR9pjIxcA4yAtFQcKf5olDWVkA== +apollo-server-types@^0.2.8: + version "0.2.8" + resolved "https://registry.yarnpkg.com/apollo-server-types/-/apollo-server-types-0.2.8.tgz#729208a8dd72831af3aa4f1eb584022ada146e6b" + integrity sha512-5OclxkAqjhuO75tTNHpSO/+doJZ+VlRtTefnrPJdK/uwVew9U/VUCWkYdryZWwEyVe1nvQ/4E7RYR4tGb8l8wA== dependencies: - apollo-engine-reporting-protobuf "0.4.0" - apollo-server-caching "0.5.0" - apollo-server-env "2.4.1" + apollo-engine-reporting-protobuf "^0.4.4" + apollo-server-caching "^0.5.0" + apollo-server-env "^2.4.3" -apollo-tracing@0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/apollo-tracing/-/apollo-tracing-0.8.1.tgz#220aeac6ad598c67f9333739155b7a56bd63ccab" - integrity sha512-zhVNC7N6hg9IJEeSEXFDxcnXD5GJQAbHxaoKVBKEolcIIsz6EGd700ORdagJgFKLReVp9O65HPrZJCg66sVx7g== +apollo-tracing@^0.8.8: + version "0.8.8" + resolved "https://registry.yarnpkg.com/apollo-tracing/-/apollo-tracing-0.8.8.tgz#bfaffd76dc12ed5cc1c1198b5411864affdb1b83" + integrity sha512-aIwT2PsH7VZZPaNrIoSjzLKMlG644d2Uf+GYcoMd3X6UEyg1sXdWqkKfCeoS6ChJKH2khO7MXAvOZC03UnCumQ== dependencies: - apollo-server-env "2.4.1" - graphql-extensions "0.8.1" + apollo-server-env "^2.4.3" + graphql-extensions "^0.10.7" apollo-utilities@^1.0.1, apollo-utilities@^1.3.0: version "1.3.2" @@ -626,23 +673,14 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== -graphql-extensions@0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.8.1.tgz#f5f1fed5fe49620c4e70c5d08bdbd0039e91c402" - integrity sha512-d/L4x7/PPWhviJqi7jIWOVJPzfzagYgPizSQUpa+3hozbWhwpWEnfxwgL5/If5MnPUikBnqlkOLCyjHMNdipYA== +graphql-extensions@^0.10.7: + version "0.10.7" + resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.10.7.tgz#ca9f8ec3cb0af1739b48ca42280ec9162ad116d1" + integrity sha512-YuP7VQxNePG4bWRQ5Vk+KRMbZ9r1IWCqCCogOMz/1ueeQ4gZe93eGRcb0vhpOdMFnCX6Vyvd4+sC+N6LR3YFOQ== dependencies: "@apollographql/apollo-tools" "^0.4.0" - apollo-server-env "2.4.1" - apollo-server-types "0.2.1" - -graphql-extensions@0.9.1: - version "0.9.1" - resolved "https://registry.yarnpkg.com/graphql-extensions/-/graphql-extensions-0.9.1.tgz#5d40b2c2cf57a35b686121d5e63783369dade5ef" - integrity sha512-JR/KStdwALd48B/xSG/Mi85zamuJd8THvVlzGM5juznPDN0wTYG5SARGzzvoqHxgxuUHYdzpvESwMAisORJdCQ== - dependencies: - "@apollographql/apollo-tools" "^0.4.0" - apollo-server-env "2.4.1" - apollo-server-types "0.2.1" + apollo-server-env "^2.4.3" + apollo-server-types "^0.2.8" graphql-subscriptions@^1.0.0: version "1.1.0" @@ -677,13 +715,6 @@ graphql-upload@^8.0.2: http-errors "^1.7.2" object-path "^0.11.4" -graphql@^14.0.2: - version "14.4.2" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-14.4.2.tgz#553a7d546d524663eda49ed6df77577be3203ae3" - integrity sha512-6uQadiRgnpnSS56hdZUSvFrVcQ6OF9y6wkxJfKquFtHlnl7+KSuWwSJsdwiK1vybm1HgcdbpGkCpvhvsVQ0UZQ== - dependencies: - iterall "^1.2.2" - has-symbols@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" @@ -764,7 +795,7 @@ is-symbol@^1.0.2: dependencies: has-symbols "^1.0.0" -iterall@^1.1.3, iterall@^1.2.1, iterall@^1.2.2: +iterall@^1.1.3, iterall@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7" integrity sha512-yynBb1g+RFUPY64fTrFv7nsjRrENBQJaX2UL+2Szc9REFrSNm1rpSXHGzhmAy7a9uv3vlvgBlXnf9RqmPH1/DA== @@ -838,10 +869,10 @@ node-fetch@^2.1.2, node-fetch@^2.2.0: resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd" integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA== -node-mocks-http@^1.7.6: - version "1.7.6" - resolved "https://registry.yarnpkg.com/node-mocks-http/-/node-mocks-http-1.7.6.tgz#b5c978d73165179a218bc9d4e3bbe73fa8bedd89" - integrity sha512-ZWbZ5HEEAoVZbAYM8KHezx0v66Te3klg/yhAmdJJ0ULWQAkSqPStEzqSjONj4zRZOrTWqsHnI6nHeJxw46gj6Q== +node-mocks-http@^1.8.0: + version "1.8.0" + resolved "https://registry.yarnpkg.com/node-mocks-http/-/node-mocks-http-1.8.0.tgz#201a882bd1f8473de6a14bf41850d373404fde32" + integrity sha512-A6YB8+sTiHZPTPf1KfwZ3sAQYSSNJTWd762IOptAmM2d6XUQ9Q1wMh+uJ7a7n2Vy6NKmODfZArqX6Rbmlg+8Fw== dependencies: accepts "^1.3.7" depd "^1.1.0" @@ -883,7 +914,7 @@ on-finished@~2.3.0: dependencies: ee-first "1.1.1" -parseurl@^1.3.3, parseurl@~1.3.3: +parseurl@^1.3.2, parseurl@^1.3.3, parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== @@ -893,25 +924,6 @@ path-to-regexp@0.1.7: resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= -protobufjs@^6.8.6: - version "6.8.8" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.8.8.tgz#c8b4f1282fd7a90e6f5b109ed11c84af82908e7c" - integrity sha512-AAmHtD5pXgZfi7GMpllpO3q1Xw1OYldr+dMUlAnffGTAhqkg72WdmSY71uKBF/JuyiKs8psYbtKrhi0ASCD8qw== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.0" - "@types/node" "^10.1.0" - long "^4.0.0" - proxy-addr@~2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" @@ -1053,10 +1065,10 @@ type-is@^1.6.16, type-is@^1.6.18, type-is@~1.6.17, type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" -typescript@^3.5.3: - version "3.5.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977" - integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g== +typescript@^3.7.3: + version "3.7.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69" + integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw== unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0"