From d687c4ab02f04926d507733a90974a300285699d Mon Sep 17 00:00:00 2001 From: mitchellhamilton Date: Mon, 7 Jun 2021 13:52:15 +1000 Subject: [PATCH] Make resolveType optional in types.union --- .changeset/heavy-chefs-warn.md | 5 +++++ packages/schema/src/output.ts | 2 +- pnpm-lock.yaml | 36 +++++++++++++++------------------- 3 files changed, 22 insertions(+), 21 deletions(-) create mode 100644 .changeset/heavy-chefs-warn.md diff --git a/.changeset/heavy-chefs-warn.md b/.changeset/heavy-chefs-warn.md new file mode 100644 index 0000000..cf9bf92 --- /dev/null +++ b/.changeset/heavy-chefs-warn.md @@ -0,0 +1,5 @@ +--- +"@ts-gql/schema": patch +--- + +`resolveType` in the arguments to `types.union` is now optional. diff --git a/packages/schema/src/output.ts b/packages/schema/src/output.ts index b63db68..8aced42 100644 --- a/packages/schema/src/output.ts +++ b/packages/schema/src/output.ts @@ -359,7 +359,7 @@ export type UnionTypeFunc = < name: string; description?: string; types: TObjectType[]; - resolveType: ( + resolveType?: ( type: TObjectType["__rootVal"], context: Parameters[0], info: GraphQLResolveInfo, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d3150c..88ffebc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -236,7 +236,7 @@ importers: react: ^16.13.1 react-dom: ^16.13.1 urql: ^1.9.7 -lockfileVersion: 5.1 +lockfileVersion: 5.2 packages: /@ampproject/toolbox-core/2.3.0: dependencies: @@ -3126,7 +3126,7 @@ packages: jest-haste-map: 25.4.0 jest-message-util: 25.4.0 jest-regex-util: 25.2.6 - jest-resolve: 25.4.0_jest-resolve@25.4.0 + jest-resolve: 25.4.0 jest-resolve-dependencies: 25.4.0 jest-runner: 25.4.0 jest-runtime: 25.4.0 @@ -3184,7 +3184,7 @@ packages: istanbul-lib-source-maps: 4.0.0 istanbul-reports: 3.0.2 jest-haste-map: 25.4.0 - jest-resolve: 25.4.0_jest-resolve@25.4.0 + jest-resolve: 25.4.0 jest-util: 25.4.0 jest-worker: 25.4.0 slash: 3.0.0 @@ -5995,7 +5995,7 @@ packages: postcss-modules-values: 3.0.0 postcss-value-parser: 4.0.3 schema-utils: 2.6.6 - webpack: 4.42.1_webpack@4.42.1 + webpack: 4.42.1 dev: false engines: node: '>= 8.9.0' @@ -8637,7 +8637,7 @@ packages: jest-get-type: 25.2.6 jest-jasmine2: 25.4.0 jest-regex-util: 25.2.6 - jest-resolve: 25.4.0_jest-resolve@25.4.0 + jest-resolve: 25.4.0 jest-util: 25.4.0 jest-validate: 25.4.0 micromatch: 4.0.2 @@ -8799,7 +8799,7 @@ packages: integrity: sha512-MdazSfcYAUjJjuVTTnusLPzE0pE4VXpOUzWdj8sbM+q6abUjm3bATVPXFqTXrxSieR8ocpvQ9v/QaQCftioQFg== /jest-pnp-resolver/1.2.1_jest-resolve@25.4.0: dependencies: - jest-resolve: 25.4.0_jest-resolve@25.4.0 + jest-resolve: 25.4.0 dev: false engines: node: '>=6' @@ -8826,7 +8826,7 @@ packages: node: '>= 8.3' resolution: integrity: sha512-A0eoZXx6kLiuG1Ui7wITQPl04HwjLErKIJTt8GR3c7UoDAtzW84JtCrgrJ6Tkw6c6MwHEyAaLk7dEPml5pf48A== - /jest-resolve/25.4.0_jest-resolve@25.4.0: + /jest-resolve/25.4.0: dependencies: '@jest/types': 25.4.0 browser-resolve: 1.11.3 @@ -8839,8 +8839,6 @@ packages: dev: false engines: node: '>= 8.3' - peerDependencies: - jest-resolve: '*' resolution: integrity: sha512-wOsKqVDFWUiv8BtLMCC6uAJ/pHZkfFgoBTgPtmYlsprAjkxrr2U++ZnB3l5ykBMd2O24lXvf30SMAjJIW6k2aA== /jest-runner/25.4.0: @@ -8858,7 +8856,7 @@ packages: jest-jasmine2: 25.4.0 jest-leak-detector: 25.4.0 jest-message-util: 25.4.0 - jest-resolve: 25.4.0_jest-resolve@25.4.0 + jest-resolve: 25.4.0 jest-runtime: 25.4.0 jest-util: 25.4.0 jest-worker: 25.4.0 @@ -8888,7 +8886,7 @@ packages: jest-message-util: 25.4.0 jest-mock: 25.4.0 jest-regex-util: 25.2.6 - jest-resolve: 25.4.0_jest-resolve@25.4.0 + jest-resolve: 25.4.0 jest-snapshot: 25.4.0 jest-util: 25.4.0 jest-validate: 25.4.0 @@ -8919,7 +8917,7 @@ packages: jest-get-type: 25.2.6 jest-matcher-utils: 25.4.0 jest-message-util: 25.4.0 - jest-resolve: 25.4.0_jest-resolve@25.4.0 + jest-resolve: 25.4.0 make-dir: 3.0.2 natural-compare: 1.4.0 pretty-format: 25.4.0 @@ -9655,7 +9653,7 @@ packages: loader-utils: 1.4.0 normalize-url: 1.9.1 schema-utils: 1.0.0 - webpack: 4.42.1_webpack@4.42.1 + webpack: 4.42.1 webpack-sources: 1.4.3 dev: false engines: @@ -9854,7 +9852,7 @@ packages: styled-jsx: 3.2.5_react@16.13.1 use-subscription: 1.1.1_react@16.13.1 watchpack: 2.0.0-beta.13 - webpack: 4.42.1_webpack@4.42.1 + webpack: 4.42.1 webpack-sources: 1.4.3 dev: false engines: @@ -11764,7 +11762,7 @@ packages: neo-async: 2.6.1 schema-utils: 2.6.6 semver: 6.3.0 - webpack: 4.42.1_webpack@4.42.1 + webpack: 4.42.1 dev: false engines: node: '>= 8.9.0' @@ -12405,7 +12403,7 @@ packages: dependencies: loader-utils: 1.4.0 schema-utils: 2.6.6 - webpack: 4.42.1_webpack@4.42.1 + webpack: 4.42.1 dev: false engines: node: '>= 8.9.0' @@ -12613,7 +12611,7 @@ packages: serialize-javascript: 2.1.2 source-map: 0.6.1 terser: 4.6.11 - webpack: 4.42.1_webpack@4.42.1 + webpack: 4.42.1 webpack-sources: 1.4.3 worker-farm: 1.7.0 dev: false @@ -13286,7 +13284,7 @@ packages: dev: false resolution: integrity: sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== - /webpack/4.42.1_webpack@4.42.1: + /webpack/4.42.1: dependencies: '@webassemblyjs/ast': 1.9.0 '@webassemblyjs/helper-module-context': 1.9.0 @@ -13315,8 +13313,6 @@ packages: engines: node: '>=6.11.5' hasBin: true - peerDependencies: - webpack: '*' resolution: integrity: sha512-SGfYMigqEfdGchGhFFJ9KyRpQKnipvEvjc1TwrXEPCM6H5Wywu10ka8o3KGrMzSMxMQKt8aCHUFh5DaQ9UmyRg== /whatwg-encoding/1.0.5: