deno.land / x / pothos@release-1713397530 / packages / plugin-sub-graph / global-types.ts

global-types.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// @ts-nocheck/* eslint-disable @typescript-eslint/no-unused-vars */import { FieldNullability, FieldRequiredness, InputFieldMap, InputShapeFromTypeParam, InputType, InterfaceParam, RootName, SchemaTypes, TypeParam, } from '../core/index.ts';import type { PothosSubGraphPlugin } from './index.ts';declare global { export namespace PothosSchemaTypes { export interface BaseTypeOptions<Types extends SchemaTypes = SchemaTypes> { subGraphs?: Types["SubGraphs"][]; } export interface BuildSchemaOptions<Types extends SchemaTypes> { subGraph?: Types["SubGraphs"] | Types["SubGraphs"][]; } export interface ObjectTypeOptions<Types extends SchemaTypes = SchemaTypes, Shape = unknown> extends BaseTypeOptions<Types> { defaultSubGraphsForFields?: Types["SubGraphs"][]; } export interface RootTypeOptions<Types extends SchemaTypes, Type extends RootName> extends BaseTypeOptions<Types> { defaultSubGraphsForFields?: Types["SubGraphs"][]; } export interface InterfaceTypeOptions<Types extends SchemaTypes = SchemaTypes, Shape = unknown, Interfaces extends InterfaceParam<Types>[] = InterfaceParam<Types>[]> extends BaseTypeOptions<Types> { defaultSubGraphsForFields?: Types["SubGraphs"][]; } export interface FieldOptions<Types extends SchemaTypes = SchemaTypes, ParentShape = unknown, Type extends TypeParam<Types> = TypeParam<Types>, Nullable extends FieldNullability<Type> = FieldNullability<Type>, Args extends InputFieldMap = InputFieldMap, ResolveShape = unknown, ResolveReturnShape = unknown> { subGraphs?: Types["SubGraphs"][]; } export interface ArgFieldOptions<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [ InputType<Types> ] = InputType<Types> | [ InputType<Types> ], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> extends InputFieldOptions<Types, Type, Req> { subGraphs?: undefined extends InputShapeFromTypeParam<Types, Type, Req> ? Types["SubGraphs"][] : never; } export interface InputObjectFieldOptions<Types extends SchemaTypes = SchemaTypes, Type extends InputType<Types> | [ InputType<Types> ] = InputType<Types> | [ InputType<Types> ], Req extends FieldRequiredness<Type> = FieldRequiredness<Type>> extends InputFieldOptions<Types, Type, Req> { subGraphs?: undefined extends InputShapeFromTypeParam<Types, Type, Req> ? Types["SubGraphs"][] : never; } export interface Plugins<Types extends SchemaTypes> { subGraph: PothosSubGraphPlugin<Types>; } export interface SchemaBuilderOptions<Types extends SchemaTypes> { subGraphs?: { defaultForTypes?: Types["SubGraphs"][]; defaultForFields?: Types["SubGraphs"][]; fieldsInheritFromTypes?: boolean; }; } export interface UserSchemaTypes { SubGraphs: string; } export interface ExtendDefaultTypes<PartialTypes extends Partial<UserSchemaTypes>> { SubGraphs: PartialTypes["SubGraphs"] & string; } }}
pothos

Version Info

Tagged at
a year ago