diff --git a/examples/typescript-node/package.json b/examples/typescript-node/package.json index 677fdf97..e5e5a13c 100644 --- a/examples/typescript-node/package.json +++ b/examples/typescript-node/package.json @@ -1,6 +1,6 @@ { "name": "typescript-node", - "version": "1.0.6", + "version": "1.0.7", "description": "", "private": true, "main": "index.js", diff --git a/packages/graphql-zeus-core/TreeToTS/functions/generated.ts b/packages/graphql-zeus-core/TreeToTS/functions/generated.ts index bfd8e06c..b4d1cfc3 100644 --- a/packages/graphql-zeus-core/TreeToTS/functions/generated.ts +++ b/packages/graphql-zeus-core/TreeToTS/functions/generated.ts @@ -609,19 +609,14 @@ export const InternalArgsBuilt = ({ return arb; }; -export const resolverFor = < - X, - T extends keyof ResolverInputTypes, - Z extends keyof ResolverInputTypes[T], - RET = unknown, ->( +export const resolverFor = ( type: T, field: Z, fn: ( args: Required[Z] extends [infer Input, any] ? Input : any, source: any, - ) => Z extends keyof ModelTypes[T] ? ModelTypes[T][Z] | Promise | X : RET, -) => fn as (args?: any, source?: any) => RET; + ) => Z extends keyof ModelTypes[T] ? ModelTypes[T][Z] | Promise | X : never, +) => fn as (args?: any, source?: any) => ReturnType; export type UnwrapPromise = T extends Promise ? R : T; export type ZeusState Promise> = NonNullable>>; diff --git a/packages/graphql-zeus-core/TreeToTS/functions/new/resolverFor.ts b/packages/graphql-zeus-core/TreeToTS/functions/new/resolverFor.ts index 30940ed9..122f62ab 100644 --- a/packages/graphql-zeus-core/TreeToTS/functions/new/resolverFor.ts +++ b/packages/graphql-zeus-core/TreeToTS/functions/new/resolverFor.ts @@ -1,15 +1,10 @@ import { ModelTypes, ResolverInputTypes } from '@/TreeToTS/functions/new/mocks'; -export const resolverFor = < - X, - T extends keyof ResolverInputTypes, - Z extends keyof ResolverInputTypes[T], - RET = unknown, ->( +export const resolverFor = ( type: T, field: Z, fn: ( args: Required[Z] extends [infer Input, any] ? Input : any, source: any, - ) => Z extends keyof ModelTypes[T] ? ModelTypes[T][Z] | Promise | X : RET, -) => fn as (args?: any, source?: any) => RET; + ) => Z extends keyof ModelTypes[T] ? ModelTypes[T][Z] | Promise | X : never, +) => fn as (args?: any, source?: any) => ReturnType; diff --git a/packages/graphql-zeus-core/package.json b/packages/graphql-zeus-core/package.json index 73221d2d..a13debb1 100644 --- a/packages/graphql-zeus-core/package.json +++ b/packages/graphql-zeus-core/package.json @@ -1,6 +1,6 @@ { "name": "graphql-zeus-core", - "version": "5.2.6", + "version": "5.2.7", "private": false, "main": "./lib/index.js", "author": "GraphQL Editor, Artur Czemiel", diff --git a/packages/graphql-zeus-jsonschema/package.json b/packages/graphql-zeus-jsonschema/package.json index 3e59bd11..58ae7943 100644 --- a/packages/graphql-zeus-jsonschema/package.json +++ b/packages/graphql-zeus-jsonschema/package.json @@ -1,6 +1,6 @@ { "name": "graphql-zeus-jsonschema", - "version": "5.2.6", + "version": "5.2.7", "private": false, "main": "./lib/index.js", "author": "GraphQL Editor, Artur Czemiel", diff --git a/packages/graphql-zeus/package.json b/packages/graphql-zeus/package.json index 8caa0b05..c452d6de 100644 --- a/packages/graphql-zeus/package.json +++ b/packages/graphql-zeus/package.json @@ -1,6 +1,6 @@ { "name": "graphql-zeus", - "version": "5.2.6", + "version": "5.2.7", "private": false, "scripts": { "start": "ttsc --build tsconfig.build.json --watch",