@ts-gql/schema
Advanced tools
Comparing version 0.7.2 to 0.7.3
# @ts-gql/schema | ||
## 0.7.3 | ||
### Patch Changes | ||
- [`0b9c783`](https://github.com/Thinkmill/ts-gql/commit/0b9c7838568b6837ad0c9cb43bac476f17e18f53) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - The types for resolvers now allow returning an array of promises for list types. | ||
## 0.7.2 | ||
@@ -4,0 +10,0 @@ |
@@ -26,3 +26,3 @@ import { GraphQLFieldExtensions, GraphQLInterfaceType, GraphQLInterfaceTypeExtensions, GraphQLIsTypeOfFn, GraphQLList, GraphQLNonNull, GraphQLObjectType, GraphQLObjectTypeExtensions, GraphQLResolveInfo, GraphQLTypeResolver, GraphQLUnionType } from "graphql/type/definition"; | ||
declare type InferValueFromOutputTypeWithoutAddingNull<Type extends OutputTypes<any>> = Type extends ScalarType<infer Value> ? Value : Type extends EnumType<infer Values> ? Values[keyof Values]["value"] : Type extends OutputListType<infer Value> ? InferValueFromOutputType<Value>[] : Type extends ObjectType<infer RootVal, string, any> ? RootVal : Type extends UnionType<ObjectType<infer RootVal, string, any>> ? RootVal : Type extends InterfaceType<infer RootVal, any, any> ? RootVal : never; | ||
export declare type InferValueFromOutputType<Type extends OutputTypes<any>> = Type extends OutputNonNullType<infer Value> ? InferValueFromOutputTypeWithoutAddingNull<Value> : InferValueFromOutputTypeWithoutAddingNull<Type> | null; | ||
export declare type InferValueFromOutputType<Type extends OutputTypes<any>> = MaybePromise<Type extends OutputNonNullType<infer Value> ? InferValueFromOutputTypeWithoutAddingNull<Value> : InferValueFromOutputTypeWithoutAddingNull<Type> | null>; | ||
export declare type ObjectType<RootVal, Name extends string, Context> = { | ||
@@ -36,3 +36,3 @@ kind: "object"; | ||
declare type MaybePromise<T> = Promise<T> | T; | ||
export declare type OutputFieldResolver<Args extends Record<string, Arg<any>>, OutputType extends OutputTypes<Context>, RootVal, Context> = (rootVal: RootVal, args: InferValueFromArgs<Args>, context: Context, info: GraphQLResolveInfo) => MaybePromise<InferValueFromOutputType<OutputType>>; | ||
export declare type OutputFieldResolver<Args extends Record<string, Arg<any>>, OutputType extends OutputTypes<Context>, RootVal, Context> = (rootVal: RootVal, args: InferValueFromArgs<Args>, context: Context, info: GraphQLResolveInfo) => InferValueFromOutputType<OutputType>; | ||
declare type SomeTypeThatIsntARecordOfArgs = string; | ||
@@ -39,0 +39,0 @@ export declare type OutputField<RootVal, Args extends Record<string, Arg<any>>, OutputType extends OutputTypes<Context>, Key extends string, Context> = { |
{ | ||
"name": "@ts-gql/schema", | ||
"version": "0.7.2", | ||
"version": "0.7.3", | ||
"main": "dist/schema.cjs.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/schema.esm.js", |
67752
1833