Comparing version 1.1.0-canary-2601bd8f646b4dae54f333609d150a6739201041 to 1.1.0-canary-67a8cae93bd528a8bbd9c3a12a454f5c675d7cd0
@@ -1,11 +0,2 @@ | ||
import { | ||
Kind, | ||
OperationTypeNode, | ||
FragmentSpreadNode, | ||
InlineFragmentNode, | ||
FieldNode, | ||
NameNode, | ||
TypeNode, | ||
DocumentNode, | ||
} from '@0no-co/graphql.web'; | ||
import { Kind, OperationTypeNode, DocumentNode } from '@0no-co/graphql.web'; | ||
@@ -339,4 +330,4 @@ /** Constraints a given string to a string literal. */ | ||
: never; | ||
type skipDigits<In extends string> = In extends `${digit}${infer In}` ? skipDigits<In> : In; | ||
type skipInt<In extends string> = In extends `${'-'}${digit}${infer In}` | ||
type skipDigits<In> = In extends `${digit}${infer In}` ? skipDigits<In> : In; | ||
type skipInt<In> = In extends `${'-'}${digit}${infer In}` | ||
? skipDigits<In> | ||
@@ -346,3 +337,3 @@ : In extends `${digit}${infer In}` | ||
: void; | ||
type skipExponent<In extends string> = In extends `${'e' | 'E'}${'+' | '-'}${infer In}` | ||
type skipExponent<In> = In extends `${'e' | 'E'}${'+' | '-'}${infer In}` | ||
? skipDigits<In> | ||
@@ -352,3 +343,3 @@ : In extends `${'e' | 'E'}${infer In}` | ||
: In; | ||
type skipFloat<In extends string> = In extends `${'.'}${infer In}` | ||
type skipFloat<In> = In extends `${'.'}${infer In}` | ||
? In extends `${digit}${infer In}` | ||
@@ -360,3 +351,3 @@ ? skipExponent<skipDigits<In>> | ||
: void; | ||
type skipBlockString<In extends string> = In extends `${infer Hd}${'"""'}${infer In}` | ||
type skipBlockString<In> = In extends `${infer Hd}${'"""'}${infer In}` | ||
? Hd extends `${infer _}${'\\'}` | ||
@@ -366,3 +357,3 @@ ? skipBlockString<skipIgnored<In>> | ||
: void; | ||
type skipString<In extends string> = In extends `${infer Hd}${'"'}${infer In}` | ||
type skipString<In> = In extends `${infer Hd}${'"'}${infer In}` | ||
? Hd extends `${infer _}${'\\'}` | ||
@@ -372,6 +363,3 @@ ? skipString<In> | ||
: void; | ||
type _takeNameLiteralRec< | ||
PrevMatch extends string, | ||
In extends string, | ||
> = In extends `${infer Match}${infer Out}` | ||
type _takeNameLiteralRec<PrevMatch extends string, In> = In extends `${infer Match}${infer Out}` | ||
? Match extends letter | digit | '_' | ||
@@ -381,3 +369,3 @@ ? _takeNameLiteralRec<`${PrevMatch}${Match}`, Out> | ||
: [PrevMatch, In]; | ||
type takeNameLiteral<In extends string> = In extends `${infer Match}${infer In}` | ||
type takeNameLiteral<In> = In extends `${infer Match}${infer In}` | ||
? Match extends letter | '_' | ||
@@ -387,3 +375,3 @@ ? _takeNameLiteralRec<Match, In> | ||
: void; | ||
type takeName<In extends string> = takeNameLiteral<In> extends [infer Out, infer In] | ||
type takeName<In> = takeNameLiteral<In> extends [infer Out, infer In] | ||
? [ | ||
@@ -397,3 +385,3 @@ { | ||
: void; | ||
type takeOptionalName<In extends string> = takeNameLiteral<In> extends [infer Out, infer In] | ||
type takeOptionalName<In> = takeNameLiteral<In> extends [infer Out, infer In] | ||
? [ | ||
@@ -407,3 +395,3 @@ { | ||
: [undefined, In]; | ||
type takeEnum<In extends string> = takeNameLiteral<In> extends [infer Out, infer In] | ||
type takeEnum<In> = takeNameLiteral<In> extends [infer Out, infer In] | ||
? [ | ||
@@ -417,3 +405,3 @@ { | ||
: void; | ||
type TakeVariable<In extends string, Const extends boolean> = Const extends false | ||
type TakeVariable<In, Const> = Const extends false | ||
? In extends `${'$'}${infer In}` | ||
@@ -434,3 +422,3 @@ ? takeNameLiteral<In> extends [infer Out, infer In] | ||
: void; | ||
type takeNumber<In extends string> = skipInt<In> extends `${infer In}` | ||
type takeNumber<In> = skipInt<In> extends `${infer In}` | ||
? skipFloat<In> extends `${infer In}` | ||
@@ -452,3 +440,3 @@ ? [ | ||
: void; | ||
type takeString<In extends string> = In extends `${'"""'}${infer In}` | ||
type takeString<In> = In extends `${'"""'}${infer In}` | ||
? skipBlockString<In> extends `${infer In}` | ||
@@ -476,3 +464,3 @@ ? [ | ||
: void; | ||
type takeLiteral<In extends string> = In extends `${'null'}${infer In}` | ||
type takeLiteral<In> = In extends `${'null'}${infer In}` | ||
? [ | ||
@@ -493,6 +481,3 @@ { | ||
: void; | ||
type takeValue<In extends string, Const extends boolean> = takeLiteral<In> extends [ | ||
infer Node, | ||
infer Rest, | ||
] | ||
type takeValue<In, Const> = takeLiteral<In> extends [infer Node, infer Rest] | ||
? [Node, Rest] | ||
@@ -512,7 +497,3 @@ : TakeVariable<In, Const> extends [infer Node, infer Rest] | ||
: void; | ||
type _takeListRec< | ||
Nodes extends unknown[], | ||
In extends string, | ||
Const extends boolean, | ||
> = In extends `${']'}${infer In}` | ||
type _takeListRec<Nodes extends any[], In, Const> = In extends `${']'}${infer In}` | ||
? [ | ||
@@ -528,9 +509,6 @@ { | ||
: void; | ||
type takeList<In extends string, Const extends boolean> = In extends `${'['}${infer In}` | ||
type takeList<In, Const> = In extends `${'['}${infer In}` | ||
? _takeListRec<[], skipIgnored<In>, Const> | ||
: void; | ||
type takeObjectField<In extends string, Const extends boolean> = takeName<In> extends [ | ||
infer Name, | ||
infer In, | ||
] | ||
type takeObjectField<In, Const> = takeName<In> extends [infer Name, infer In] | ||
? skipIgnored<In> extends `${':'}${infer In}` | ||
@@ -549,7 +527,3 @@ ? takeValue<skipIgnored<In>, Const> extends [infer Value, infer In] | ||
: void; | ||
type _takeObjectRec< | ||
Fields extends unknown[], | ||
In extends string, | ||
Const extends boolean, | ||
> = In extends `${'}'}${infer In}` | ||
type _takeObjectRec<Fields extends any[], In, Const> = In extends `${'}'}${infer In}` | ||
? [ | ||
@@ -565,9 +539,6 @@ { | ||
: void; | ||
type takeObject<In extends string, Const extends boolean> = In extends `${'{'}${infer In}` | ||
type takeObject<In, Const> = In extends `${'{'}${infer In}` | ||
? _takeObjectRec<[], skipIgnored<In>, Const> | ||
: void; | ||
type takeArgument<In extends string, Const extends boolean> = takeName<In> extends [ | ||
infer Name, | ||
infer In, | ||
] | ||
type takeArgument<In, Const> = takeName<In> extends [infer Name, infer In] | ||
? skipIgnored<In> extends `${':'}${infer In}` | ||
@@ -586,7 +557,3 @@ ? takeValue<skipIgnored<In>, Const> extends [infer Value, infer In] | ||
: void; | ||
type _takeArgumentsRec< | ||
Arguments extends unknown[], | ||
In extends string, | ||
Const extends boolean, | ||
> = In extends `${')'}${infer In}` | ||
type _takeArgumentsRec<Arguments extends any[], In, Const> = In extends `${')'}${infer In}` | ||
? Arguments extends [] | ||
@@ -598,6 +565,6 @@ ? void | ||
: void; | ||
type takeArguments<In extends string, Const extends boolean> = In extends `${'('}${infer In}` | ||
type takeArguments<In, Const> = In extends `${'('}${infer In}` | ||
? _takeArgumentsRec<[], skipIgnored<In>, Const> | ||
: [[], In]; | ||
type takeDirective<In extends string, Const extends boolean> = In extends `${'@'}${infer In}` | ||
type takeDirective<In, Const> = In extends `${'@'}${infer In}` | ||
? takeName<In> extends [infer Name, infer In] | ||
@@ -616,6 +583,3 @@ ? takeArguments<skipIgnored<In>, Const> extends [infer Arguments, infer In] | ||
: void; | ||
type takeDirectives<In extends string, Const extends boolean> = takeDirective<In, Const> extends [ | ||
infer Directive, | ||
infer In, | ||
] | ||
type takeDirectives<In, Const> = takeDirective<In, Const> extends [infer Directive, infer In] | ||
? takeDirectives<skipIgnored<In>, Const> extends [[...infer Directives], infer In] | ||
@@ -625,3 +589,3 @@ ? [[Directive, ...Directives], In] | ||
: [[], In]; | ||
type takeFieldName<In extends string> = takeName<In> extends [infer MaybeAlias, infer In] | ||
type takeFieldName<In> = takeName<In> extends [infer MaybeAlias, infer In] | ||
? skipIgnored<In> extends `${':'}${infer In}` | ||
@@ -633,3 +597,3 @@ ? takeName<skipIgnored<In>> extends [infer Name, infer In] | ||
: void; | ||
type takeField<In extends string> = takeFieldName<In> extends [infer Alias, infer Name, infer In] | ||
type takeField<In> = takeFieldName<In> extends [infer Alias, infer Name, infer In] | ||
? takeArguments<skipIgnored<In>, false> extends [infer Arguments, infer In] | ||
@@ -663,3 +627,3 @@ ? takeDirectives<skipIgnored<In>, false> extends [infer Directives, infer In] | ||
: void; | ||
type takeType<In extends string> = In extends `${'['}${infer In}` | ||
type takeType<In> = In extends `${'['}${infer In}` | ||
? takeType<skipIgnored<In>> extends [infer Subtype, infer In] | ||
@@ -707,3 +671,3 @@ ? In extends `${']'}${infer In}` | ||
: void; | ||
type takeTypeCondition<In extends string> = In extends `${'on'}${infer In}` | ||
type takeTypeCondition<In> = In extends `${'on'}${infer In}` | ||
? takeName<skipIgnored<In>> extends [infer Name, infer In] | ||
@@ -719,3 +683,3 @@ ? [ | ||
: void; | ||
type takeFragmentSpread<In extends string> = In extends `${'...'}${infer In}` | ||
type takeFragmentSpread<In> = In extends `${'...'}${infer In}` | ||
? skipIgnored<In> extends `${'on'}${infer In}` | ||
@@ -765,6 +729,3 @@ ? takeName<skipIgnored<In>> extends [infer Name, infer In] | ||
: void; | ||
type _takeSelectionRec< | ||
Selections extends unknown[], | ||
In extends string, | ||
> = In extends `${'}'}${infer In}` | ||
type _takeSelectionRec<Selections extends any[], In> = In extends `${'}'}${infer In}` | ||
? [ | ||
@@ -782,9 +743,6 @@ { | ||
: void; | ||
type takeSelectionSet<In extends string> = In extends `${'{'}${infer In}` | ||
type takeSelectionSet<In> = In extends `${'{'}${infer In}` | ||
? _takeSelectionRec<[], skipIgnored<In>> | ||
: void; | ||
type takeVarDefinition<In extends string> = TakeVariable<In, false> extends [ | ||
infer Variable, | ||
infer In, | ||
] | ||
type takeVarDefinition<In> = TakeVariable<In, false> extends [infer Variable, infer In] | ||
? skipIgnored<In> extends `${':'}${infer In}` | ||
@@ -822,6 +780,3 @@ ? takeType<skipIgnored<In>> extends [infer Type, infer In] | ||
: void; | ||
type _takeVarDefinitionRec< | ||
Definitions extends unknown[], | ||
In extends string, | ||
> = In extends `${')'}${infer In}` | ||
type _takeVarDefinitionRec<Definitions extends any[], In> = In extends `${')'}${infer In}` | ||
? [Definitions, In] | ||
@@ -831,6 +786,6 @@ : takeVarDefinition<In> extends [infer Definition, infer In] | ||
: void; | ||
type takeVarDefinitions<In extends string> = skipIgnored<In> extends `${'('}${infer In}` | ||
type takeVarDefinitions<In> = skipIgnored<In> extends `${'('}${infer In}` | ||
? _takeVarDefinitionRec<[], skipIgnored<In>> | ||
: [[], In]; | ||
type takeFragmentDefinition<In extends string> = In extends `${'fragment'}${infer In}` | ||
type takeFragmentDefinition<In> = In extends `${'fragment'}${infer In}` | ||
? takeName<skipIgnored<In>> extends [infer Name, infer In] | ||
@@ -855,3 +810,3 @@ ? takeTypeCondition<skipIgnored<In>> extends [infer TypeCondition, infer In] | ||
: void; | ||
type TakeOperation<In extends string> = In extends `${'query'}${infer In}` | ||
type TakeOperation<In> = In extends `${'query'}${infer In}` | ||
? [OperationTypeNode.QUERY, In] | ||
@@ -863,6 +818,3 @@ : In extends `${'mutation'}${infer In}` | ||
: void; | ||
type takeOperationDefinition<In extends string> = TakeOperation<In> extends [ | ||
infer Operation, | ||
infer In, | ||
] | ||
type takeOperationDefinition<In> = TakeOperation<In> extends [infer Operation, infer In] | ||
? takeOptionalName<skipIgnored<In>> extends [infer Name, infer In] | ||
@@ -900,6 +852,6 @@ ? takeVarDefinitions<skipIgnored<In>> extends [infer VarDefinitions, infer In] | ||
: void; | ||
type _takeDocumentRec< | ||
Definitions extends unknown[], | ||
In extends string, | ||
> = takeFragmentDefinition<In> extends [infer Definition, infer In] | ||
type _takeDocumentRec<Definitions extends any[], In> = takeFragmentDefinition<In> extends [ | ||
infer Definition, | ||
infer In, | ||
] | ||
? _takeDocumentRec<[...Definitions, Definition], skipIgnored<In>> | ||
@@ -909,3 +861,3 @@ : takeOperationDefinition<In> extends [infer Definition, infer In] | ||
: [Definitions, In]; | ||
type parseDocument<In extends string> = _takeDocumentRec<[], skipIgnored<In>> extends [ | ||
type parseDocument<In> = _takeDocumentRec<[], skipIgnored<In>> extends [ | ||
[...infer Definitions], | ||
@@ -1041,8 +993,4 @@ infer _Rest, | ||
type _unwrapTypeRec$1< | ||
Type extends IntrospectionTypeRef, | ||
SelectionSet extends | ||
| { | ||
kind: Kind.SELECTION_SET; | ||
} | ||
| undefined, | ||
Type, | ||
SelectionSet, | ||
Introspection extends IntrospectionLikeType, | ||
@@ -1052,7 +1000,15 @@ Fragments extends { | ||
}, | ||
> = Type extends IntrospectionNonNullTypeRef | ||
> = Type extends { | ||
readonly kind: 'NON_NULL'; | ||
readonly ofType: any; | ||
} | ||
? _unwrapTypeRec$1<Type['ofType'], SelectionSet, Introspection, Fragments> | ||
: Type extends IntrospectionListTypeRef | ||
: Type extends { | ||
readonly kind: 'LIST'; | ||
readonly ofType: any; | ||
} | ||
? Array<unwrapType$1<Type['ofType'], SelectionSet, Introspection, Fragments>> | ||
: Type extends IntrospectionNamedTypeRef | ||
: Type extends { | ||
readonly name: string; | ||
} | ||
? Introspection['types'][Type['name']] extends ObjectLikeType | ||
@@ -1073,8 +1029,4 @@ ? SelectionSet extends { | ||
type unwrapType$1< | ||
Type extends IntrospectionTypeRef, | ||
SelectionSet extends | ||
| { | ||
kind: Kind.SELECTION_SET; | ||
} | ||
| undefined, | ||
Type, | ||
SelectionSet, | ||
Introspection extends IntrospectionLikeType, | ||
@@ -1085,3 +1037,6 @@ Fragments extends { | ||
TypeDirective = void, | ||
> = Type extends IntrospectionNonNullTypeRef | ||
> = Type extends { | ||
readonly kind: 'NON_NULL'; | ||
readonly ofType: any; | ||
} | ||
? TypeDirective extends 'optional' | ||
@@ -1093,35 +1048,30 @@ ? null | _unwrapTypeRec$1<Type['ofType'], SelectionSet, Introspection, Fragments> | ||
: null | _unwrapTypeRec$1<Type, SelectionSet, Introspection, Fragments>; | ||
type getTypeDirective<Directives extends readonly unknown[] | undefined> = | ||
Directives extends readonly [infer Directive, ...infer Rest] | ||
? Directive extends { | ||
kind: Kind.DIRECTIVE; | ||
name: any; | ||
type getTypeDirective<Node> = Node extends { | ||
directives: any[]; | ||
} | ||
? Node['directives'][number]['name']['value'] & ('required' | '_required') extends never | ||
? Node['directives'][number]['name']['value'] & ('optional' | '_optional') extends never | ||
? void | ||
: 'optional' | ||
: 'required' | ||
: void; | ||
type isOptional<Node> = Node extends { | ||
directives: any[]; | ||
} | ||
? Node['directives'][number]['name']['value'] & ('include' | 'skip' | 'defer') extends never | ||
? false | ||
: true | ||
: false; | ||
type getFieldAlias<Node> = Node extends { | ||
alias: undefined; | ||
name: any; | ||
} | ||
? Node['name']['value'] | ||
: Node extends { | ||
alias: any; | ||
} | ||
? Directive['name']['value'] extends 'required' | '_required' | ||
? 'required' | ||
: Directive['name']['value'] extends 'optional' | '_optional' | ||
? 'optional' | ||
: getTypeDirective<Rest> | ||
: getTypeDirective<Rest> | ||
: void; | ||
type isOptionalRec<Directives extends readonly unknown[] | undefined> = | ||
Directives extends readonly [infer Directive, ...infer Rest] | ||
? Directive extends { | ||
kind: Kind.DIRECTIVE; | ||
name: any; | ||
} | ||
? Directive['name']['value'] extends 'include' | 'skip' | 'defer' | ||
? true | ||
: isOptionalRec<Rest> | ||
: isOptionalRec<Rest> | ||
: false; | ||
type getFieldAlias<Node extends FieldNode> = Node['alias'] extends undefined | ||
? Node['name']['value'] | ||
: Node['alias'] extends NameNode | ||
? Node['alias']['value'] | ||
: never; | ||
type getFragmentSelection< | ||
Node extends { | ||
kind: Kind.FRAGMENT_SPREAD | Kind.INLINE_FRAGMENT; | ||
}, | ||
Node, | ||
Type extends ObjectLikeType, | ||
@@ -1155,5 +1105,3 @@ Introspection extends IntrospectionLikeType, | ||
type getSpreadSubtype< | ||
Node extends { | ||
kind: Kind.FRAGMENT_SPREAD | Kind.INLINE_FRAGMENT; | ||
}, | ||
Node, | ||
BaseType extends ObjectLikeType, | ||
@@ -1182,9 +1130,15 @@ Introspection extends IntrospectionLikeType, | ||
: void; | ||
type getTypenameOfType<Type extends ObjectLikeType> = Type extends { | ||
possibleTypes: any; | ||
} | ||
? Type['name'] | Type['possibleTypes'] | ||
: Type['name']; | ||
type getTypenameOfType<Type> = | ||
| (Type extends { | ||
name: any; | ||
} | ||
? Type['name'] | ||
: never) | ||
| (Type extends { | ||
possibleTypes: any; | ||
} | ||
? Type['possibleTypes'] | ||
: never); | ||
type getSelection< | ||
Selections extends readonly any[], | ||
Selections, | ||
Type extends ObjectLikeType, | ||
@@ -1195,5 +1149,25 @@ Introspection extends IntrospectionLikeType, | ||
}, | ||
> = obj<getPossibleTypesSelection<Selections, Type, Introspection, Fragments>>; | ||
> = obj< | ||
Type extends { | ||
kind: 'UNION' | 'INTERFACE'; | ||
possibleTypes: any; | ||
} | ||
? objValues<{ | ||
[PossibleType in Type['possibleTypes']]: _getPossibleTypeSelectionRec< | ||
Selections, | ||
PossibleType, | ||
Type, | ||
Introspection, | ||
Fragments | ||
>; | ||
}> | ||
: Type extends { | ||
kind: 'OBJECT'; | ||
name: any; | ||
} | ||
? _getPossibleTypeSelectionRec<Selections, Type['name'], Type, Introspection, Fragments> | ||
: {} | ||
>; | ||
type _getPossibleTypeSelectionRec< | ||
Selections extends readonly unknown[], | ||
Selections, | ||
PossibleType extends string, | ||
@@ -1206,3 +1180,5 @@ Type extends ObjectLikeType, | ||
> = Selections extends [infer Node, ...infer Rest] | ||
? (Node extends FragmentSpreadNode | InlineFragmentNode | ||
? (Node extends { | ||
kind: Kind.FRAGMENT_SPREAD | Kind.INLINE_FRAGMENT; | ||
} | ||
? getSpreadSubtype<Node, Type, Introspection, Fragments> extends infer Subtype extends | ||
@@ -1212,10 +1188,17 @@ ObjectLikeType | ||
? | ||
| (isOptionalRec<Node['directives']> extends true ? {} : never) | ||
| (isOptional<Node> extends true ? {} : never) | ||
| getFragmentSelection<Node, Subtype, Introspection, Fragments> | ||
: {} | ||
: Node extends FragmentSpreadNode | ||
: Node extends { | ||
kind: Kind.FRAGMENT_SPREAD; | ||
name: any; | ||
} | ||
? makeUndefinedFragmentRef<Node['name']['value']> | ||
: {} | ||
: Node extends FieldNode | ||
? isOptionalRec<Node['directives']> extends true | ||
: Node extends { | ||
kind: Kind.FIELD; | ||
name: any; | ||
selectionSet: any; | ||
} | ||
? isOptional<Node> extends true | ||
? { | ||
@@ -1229,3 +1212,3 @@ [Prop in getFieldAlias<Node>]?: Node['name']['value'] extends '__typename' | ||
Fragments, | ||
getTypeDirective<Node['directives']> | ||
getTypeDirective<Node> | ||
>; | ||
@@ -1241,3 +1224,3 @@ } | ||
Fragments, | ||
getTypeDirective<Node['directives']> | ||
getTypeDirective<Node> | ||
>; | ||
@@ -1248,28 +1231,2 @@ } | ||
: {}; | ||
type getPossibleTypesSelection< | ||
Selections extends readonly unknown[], | ||
Type extends ObjectLikeType, | ||
Introspection extends IntrospectionLikeType, | ||
Fragments extends { | ||
[name: string]: any; | ||
}, | ||
> = Type extends { | ||
kind: 'UNION' | 'INTERFACE'; | ||
possibleTypes: any; | ||
} | ||
? objValues<{ | ||
[PossibleType in Type['possibleTypes']]: _getPossibleTypeSelectionRec< | ||
Selections, | ||
PossibleType, | ||
Type, | ||
Introspection, | ||
Fragments | ||
>; | ||
}> | ||
: Type extends { | ||
kind: 'OBJECT'; | ||
name: any; | ||
} | ||
? _getPossibleTypeSelectionRec<Selections, Type['name'], Type, Introspection, Fragments> | ||
: {}; | ||
type getOperationSelectionType< | ||
@@ -1337,3 +1294,3 @@ Definition, | ||
type getInputObjectTypeRec< | ||
InputFields extends readonly unknown[], | ||
InputFields, | ||
Introspection extends IntrospectionLikeType, | ||
@@ -1345,6 +1302,4 @@ > = InputFields extends [infer InputField, ...infer Rest] | ||
} | ||
? InputField extends { | ||
type: { | ||
kind: 'NON_NULL'; | ||
}; | ||
? InputField['type'] extends { | ||
kind: 'NON_NULL'; | ||
} | ||
@@ -1361,3 +1316,3 @@ ? { | ||
type getScalarType< | ||
TypeName extends string, | ||
TypeName, | ||
Introspection extends IntrospectionLikeType, | ||
@@ -1367,17 +1322,15 @@ > = TypeName extends keyof Introspection['types'] | ||
kind: 'SCALAR' | 'ENUM'; | ||
type: infer IntrospectionValueType; | ||
type: any; | ||
} | ||
? IntrospectionValueType | ||
? Introspection['types'][TypeName]['type'] | ||
: Introspection['types'][TypeName] extends { | ||
kind: 'INPUT_OBJECT'; | ||
inputFields: [...infer InputFields]; | ||
inputFields: any; | ||
} | ||
? obj<getInputObjectTypeRec<InputFields, Introspection>> | ||
? obj<getInputObjectTypeRec<Introspection['types'][TypeName]['inputFields'], Introspection>> | ||
: never | ||
: unknown; | ||
type _unwrapTypeRec< | ||
TypeRef extends TypeNode, | ||
Introspection extends IntrospectionLikeType, | ||
> = TypeRef extends { | ||
type _unwrapTypeRec<TypeRef, Introspection extends IntrospectionLikeType> = TypeRef extends { | ||
kind: 'NON_NULL'; | ||
ofType: any; | ||
} | ||
@@ -1387,2 +1340,3 @@ ? _unwrapTypeRec<TypeRef['ofType'], Introspection> | ||
kind: 'LIST'; | ||
ofType: any; | ||
} | ||
@@ -1395,16 +1349,16 @@ ? Array<unwrapType<TypeRef['ofType'], Introspection>> | ||
: unknown; | ||
type unwrapType<Type extends TypeNode, Introspection extends IntrospectionLikeType> = Type extends { | ||
type unwrapType<Type, Introspection extends IntrospectionLikeType> = Type extends { | ||
kind: 'NON_NULL'; | ||
ofType: any; | ||
} | ||
? _unwrapTypeRec<Type['ofType'], Introspection> | ||
: null | _unwrapTypeRec<Type, Introspection>; | ||
type _nwrapTypeRefRec< | ||
Type extends TypeNode, | ||
Introspection extends IntrospectionLikeType, | ||
> = Type extends { | ||
type _unwrapTypeRefRec<Type, Introspection extends IntrospectionLikeType> = Type extends { | ||
kind: Kind.NON_NULL_TYPE; | ||
type: any; | ||
} | ||
? _nwrapTypeRefRec<Type['type'], Introspection> | ||
? _unwrapTypeRefRec<Type['type'], Introspection> | ||
: Type extends { | ||
kind: Kind.LIST_TYPE; | ||
type: any; | ||
} | ||
@@ -1418,14 +1372,12 @@ ? Array<unwrapTypeRef<Type['type'], Introspection>> | ||
: unknown; | ||
type unwrapTypeRef< | ||
Type extends TypeNode, | ||
Introspection extends IntrospectionLikeType, | ||
> = Type extends { | ||
type unwrapTypeRef<Type, Introspection extends IntrospectionLikeType> = Type extends { | ||
kind: Kind.NON_NULL_TYPE; | ||
type: any; | ||
} | ||
? _nwrapTypeRefRec<Type['type'], Introspection> | ||
: null | _nwrapTypeRefRec<Type, Introspection>; | ||
type getVariablesRec< | ||
Variables extends readonly unknown[], | ||
Introspection extends IntrospectionLikeType, | ||
> = Variables extends [infer Variable, ...infer Rest] | ||
? _unwrapTypeRefRec<Type['type'], Introspection> | ||
: null | _unwrapTypeRefRec<Type, Introspection>; | ||
type getVariablesRec<Variables, Introspection extends IntrospectionLikeType> = Variables extends [ | ||
infer Variable, | ||
...infer Rest, | ||
] | ||
? (Variable extends { | ||
@@ -1432,0 +1384,0 @@ kind: Kind.VARIABLE_DEFINITION; |
{ | ||
"name": "gql.tada", | ||
"description": "The spec-compliant & magical GraphQL query language engine in the TypeScript type system", | ||
"version": "1.1.0-canary-2601bd8f646b4dae54f333609d150a6739201041", | ||
"version": "1.1.0-canary-67a8cae93bd528a8bbd9c3a12a454f5c675d7cd0", | ||
"author": "0no.co <hi@0no.co>", | ||
@@ -6,0 +6,0 @@ "source": "./src/index.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87219
1737