@pothos/plugin-relay
Advanced tools
Comparing version 3.28.2 to 3.28.3
# Change Log | ||
## 3.28.3 | ||
### Patch Changes | ||
- 3a82d645: Apply esm transform to esm d.ts definitions | ||
## 3.28.2 | ||
@@ -4,0 +10,0 @@ |
export {}; | ||
//# sourceMappingURL=field-builder.d.ts.map | ||
//# sourceMappingURL=field-builder.d.ts.map |
import { FieldKind, FieldNullability, FieldOptionsFromKind, FieldRef, FieldRequiredness, InputFieldMap, InputFieldRef, InputFieldsFromShape, InputShapeFromFields, InputShapeFromTypeParam, inputShapeKey, InterfaceParam, NormalizeArgs, ObjectFieldsShape, ObjectFieldThunk, ObjectParam, OutputShape, OutputType, ParentShape, Resolver, SchemaTypes, ShapeFromTypeParam } from '@pothos/core'; | ||
import { ConnectionShape, ConnectionShapeForType, ConnectionShapeFromResolve, GlobalIDFieldOptions, GlobalIDInputFieldOptions, GlobalIDInputShape, GlobalIDListFieldOptions, GlobalIDListInputFieldOptions, InputShapeWithClientMutationId, NodeFieldOptions, NodeListFieldOptions, NodeObjectOptions, PageInfoShape, RelayMutationFieldOptions, RelayMutationInputOptions, RelayMutationPayloadOptions, RelayPluginOptions } from './types'; | ||
import type { DefaultEdgesNullability, PothosRelayPlugin } from '.'; | ||
import { ConnectionShape, ConnectionShapeForType, ConnectionShapeFromResolve, GlobalIDFieldOptions, GlobalIDInputFieldOptions, GlobalIDInputShape, GlobalIDListFieldOptions, GlobalIDListInputFieldOptions, InputShapeWithClientMutationId, NodeFieldOptions, NodeListFieldOptions, NodeObjectOptions, PageInfoShape, RelayMutationFieldOptions, RelayMutationInputOptions, RelayMutationPayloadOptions, RelayPluginOptions } from './types.js'; | ||
import type { DefaultEdgesNullability, PothosRelayPlugin } from './index.js'; | ||
declare global { | ||
@@ -14,11 +14,15 @@ export namespace PothosSchemaTypes { | ||
Connection: {}; | ||
DefaultEdgesNullability: FieldNullability<[unknown]>; | ||
DefaultEdgesNullability: FieldNullability<[ | ||
unknown | ||
]>; | ||
DefaultNodeNullability: boolean; | ||
} | ||
interface ExtendDefaultTypes<PartialTypes extends Partial<UserSchemaTypes>> { | ||
Connection: PartialTypes['Connection'] & {}; | ||
Connection: PartialTypes["Connection"] & {}; | ||
DefaultEdgesNullability: FieldNullability<[ | ||
unknown | ||
]> extends PartialTypes['DefaultEdgesNullability'] ? DefaultEdgesNullability : PartialTypes['DefaultEdgesNullability'] & FieldNullability<[unknown]>; | ||
DefaultNodeNullability: boolean extends PartialTypes['DefaultNodeNullability'] ? false : PartialTypes['DefaultNodeNullability'] & boolean; | ||
]> extends PartialTypes["DefaultEdgesNullability"] ? DefaultEdgesNullability : PartialTypes["DefaultEdgesNullability"] & FieldNullability<[ | ||
unknown | ||
]>; | ||
DefaultNodeNullability: boolean extends PartialTypes["DefaultNodeNullability"] ? false : PartialTypes["DefaultNodeNullability"] & boolean; | ||
} | ||
@@ -31,7 +35,9 @@ interface SchemaBuilder<Types extends SchemaTypes> { | ||
globalConnectionField: (name: string, field: ObjectFieldThunk<Types, ConnectionShape<Types, {}, false>>) => void; | ||
relayMutationField: <Fields extends InputFieldMap, Nullable extends boolean, ResolveShape, ResolveReturnShape, Interfaces extends InterfaceParam<Types>[], InputName extends string = 'input'>(name: string, inputOptions: InputObjectRef<unknown> | RelayMutationInputOptions<Types, Fields, InputName>, fieldOptions: RelayMutationFieldOptions<Types, Fields, Nullable, InputName, ResolveShape, ResolveReturnShape>, payloadOptions: RelayMutationPayloadOptions<Types, ResolveShape, Interfaces>) => { | ||
relayMutationField: <Fields extends InputFieldMap, Nullable extends boolean, ResolveShape, ResolveReturnShape, Interfaces extends InterfaceParam<Types>[], InputName extends string = "input">(name: string, inputOptions: InputObjectRef<unknown> | RelayMutationInputOptions<Types, Fields, InputName>, fieldOptions: RelayMutationFieldOptions<Types, Fields, Nullable, InputName, ResolveShape, ResolveReturnShape>, payloadOptions: RelayMutationPayloadOptions<Types, ResolveShape, Interfaces>) => { | ||
inputType: InputObjectRef<InputShapeWithClientMutationId<Types, Fields>>; | ||
payloadType: ObjectRef<ResolveShape>; | ||
}; | ||
connectionObject: <Type extends OutputType<Types>, ResolveReturnShape, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean>(connectionOptions: ConnectionObjectOptions<Types, Type, EdgeNullability, NodeNullability, ResolveReturnShape> & { | ||
connectionObject: <Type extends OutputType<Types>, ResolveReturnShape, EdgeNullability extends FieldNullability<[ | ||
unknown | ||
]>, NodeNullability extends boolean>(connectionOptions: ConnectionObjectOptions<Types, Type, EdgeNullability, NodeNullability, ResolveReturnShape> & { | ||
name: string; | ||
@@ -47,3 +53,3 @@ type: Type; | ||
]>) => ObjectRef<ConnectionShapeForType<Types, Type, false, EdgeNullability, NodeNullability>>; | ||
edgeObject: <Type extends OutputType<Types>, ResolveReturnShape, NodeNullability extends boolean = Types['DefaultNodeNullability']>(edgeOptions: ConnectionEdgeObjectOptions<Types, Type, NodeNullability, ResolveReturnShape> & { | ||
edgeObject: <Type extends OutputType<Types>, ResolveReturnShape, NodeNullability extends boolean = Types["DefaultNodeNullability"]>(edgeOptions: ConnectionEdgeObjectOptions<Types, Type, NodeNullability, ResolveReturnShape> & { | ||
type: Type; | ||
@@ -57,8 +63,14 @@ name: string; | ||
} | ||
interface InputFieldBuilder<Types extends SchemaTypes, Kind extends 'Arg' | 'InputObject'> { | ||
interface InputFieldBuilder<Types extends SchemaTypes, Kind extends "Arg" | "InputObject"> { | ||
connectionArgs: () => { | ||
[K in keyof DefaultConnectionArguments]-?: InputFieldRef<DefaultConnectionArguments[K], Kind>; | ||
}; | ||
globalID: <Req extends boolean>(...args: NormalizeArgs<[options: GlobalIDInputFieldOptions<Types, Req, Kind>]>) => InputFieldRef<InputShapeFromTypeParam<Types, GlobalIDInputShape, Req>, Kind>; | ||
globalIDList: <Req extends FieldRequiredness<['ID']>>(...args: NormalizeArgs<[options: GlobalIDListInputFieldOptions<Types, Req, Kind>]>) => InputFieldRef<InputShapeFromTypeParam<Types, [ | ||
globalID: <Req extends boolean>(...args: NormalizeArgs<[ | ||
options: GlobalIDInputFieldOptions<Types, Req, Kind> | ||
]>) => InputFieldRef<InputShapeFromTypeParam<Types, GlobalIDInputShape, Req>, Kind>; | ||
globalIDList: <Req extends FieldRequiredness<[ | ||
"ID" | ||
]>>(...args: NormalizeArgs<[ | ||
options: GlobalIDListInputFieldOptions<Types, Req, Kind> | ||
]>) => InputFieldRef<InputShapeFromTypeParam<Types, [ | ||
{ | ||
@@ -73,8 +85,14 @@ [inputShapeKey]: { | ||
interface RootFieldBuilder<Types extends SchemaTypes, ParentShape, Kind extends FieldKind = FieldKind> { | ||
globalID: <Args extends InputFieldMap, Nullable extends FieldNullability<'ID'>, ResolveReturnShape>(options: GlobalIDFieldOptions<Types, ParentShape, Args, Nullable, ResolveReturnShape, Kind>) => FieldRef<ShapeFromTypeParam<Types, 'ID', Nullable>>; | ||
globalIDList: <Args extends InputFieldMap, Nullable extends FieldNullability<['ID']>, ResolveReturnShape>(options: GlobalIDListFieldOptions<Types, ParentShape, Args, Nullable, ResolveReturnShape, Kind>) => FieldRef<ShapeFromTypeParam<Types, ['ID'], Nullable>>; | ||
globalID: <Args extends InputFieldMap, Nullable extends FieldNullability<"ID">, ResolveReturnShape>(options: GlobalIDFieldOptions<Types, ParentShape, Args, Nullable, ResolveReturnShape, Kind>) => FieldRef<ShapeFromTypeParam<Types, "ID", Nullable>>; | ||
globalIDList: <Args extends InputFieldMap, Nullable extends FieldNullability<[ | ||
"ID" | ||
]>, ResolveReturnShape>(options: GlobalIDListFieldOptions<Types, ParentShape, Args, Nullable, ResolveReturnShape, Kind>) => FieldRef<ShapeFromTypeParam<Types, [ | ||
"ID" | ||
], Nullable>>; | ||
node: <Args extends InputFieldMap, ResolveShape>(options: NodeFieldOptions<Types, ParentShape, Args, ResolveShape, Kind>) => FieldRef<unknown>; | ||
nodeList: <Args extends InputFieldMap, ResolveShape>(options: NodeListFieldOptions<Types, ParentShape, Args, ResolveShape, Kind>) => FieldRef<unknown[]>; | ||
connection: <Type extends OutputType<Types>, Args extends InputFieldMap, Nullable extends boolean, ResolveReturnShape, EdgeNullability extends FieldNullability<[unknown]> = Types['DefaultEdgesNullability'], NodeNullability extends boolean = Types['DefaultNodeNullability']>(options: ConnectionFieldOptions<Types, ParentShape, Type, Nullable, EdgeNullability, NodeNullability, Args, ResolveReturnShape> & Omit<FieldOptionsFromKind<Types, ParentShape, Type, Nullable, (InputFieldMap extends Args ? {} : Args) & InputFieldsFromShape<DefaultConnectionArguments>, Kind, ParentShape, ResolveReturnShape>, 'args' | 'resolve' | 'type'>, ...args: NormalizeArgs<[ | ||
connectionOptions: ObjectRef<ConnectionShapeForType<Types, Type, false, EdgeNullability, NodeNullability>> | Omit<ConnectionObjectOptions<Types, Type, EdgeNullability, NodeNullability, ResolveReturnShape>, 'edgesNullable'>, | ||
connection: <Type extends OutputType<Types>, Args extends InputFieldMap, Nullable extends boolean, ResolveReturnShape, EdgeNullability extends FieldNullability<[ | ||
unknown | ||
]> = Types["DefaultEdgesNullability"], NodeNullability extends boolean = Types["DefaultNodeNullability"]>(options: ConnectionFieldOptions<Types, ParentShape, Type, Nullable, EdgeNullability, NodeNullability, Args, ResolveReturnShape> & Omit<FieldOptionsFromKind<Types, ParentShape, Type, Nullable, (InputFieldMap extends Args ? {} : Args) & InputFieldsFromShape<DefaultConnectionArguments>, Kind, ParentShape, ResolveReturnShape>, "args" | "resolve" | "type">, ...args: NormalizeArgs<[ | ||
connectionOptions: ObjectRef<ConnectionShapeForType<Types, Type, false, EdgeNullability, NodeNullability>> | Omit<ConnectionObjectOptions<Types, Type, EdgeNullability, NodeNullability, ResolveReturnShape>, "edgesNullable">, | ||
edgeOptions: ObjectRef<{ | ||
@@ -86,3 +104,5 @@ cursor: string; | ||
} | ||
interface ConnectionFieldOptions<Types extends SchemaTypes, ParentShape, Type extends OutputType<Types>, Nullable extends boolean, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean, Args extends InputFieldMap, ResolveReturnShape> { | ||
interface ConnectionFieldOptions<Types extends SchemaTypes, ParentShape, Type extends OutputType<Types>, Nullable extends boolean, EdgeNullability extends FieldNullability<[ | ||
unknown | ||
]>, NodeNullability extends boolean, Args extends InputFieldMap, ResolveReturnShape> { | ||
type: Type; | ||
@@ -92,5 +112,7 @@ args?: Args; | ||
nodeNullable?: NodeNullability; | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args> & DefaultConnectionArguments, Types['Context'], ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability>, ResolveReturnShape>; | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args> & DefaultConnectionArguments, Types["Context"], ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability>, ResolveReturnShape>; | ||
} | ||
interface ConnectionObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean, Resolved> extends ObjectTypeOptions<Types, ConnectionShapeFromResolve<Types, Type, false, EdgeNullability, NodeNullability, Resolved>> { | ||
interface ConnectionObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, EdgeNullability extends FieldNullability<[ | ||
unknown | ||
]>, NodeNullability extends boolean, Resolved> extends ObjectTypeOptions<Types, ConnectionShapeFromResolve<Types, Type, false, EdgeNullability, NodeNullability, Resolved>> { | ||
name?: string; | ||
@@ -100,3 +122,3 @@ edgesNullable?: EdgeNullability; | ||
} | ||
interface ConnectionEdgeObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, NodeNullability extends boolean, Resolved> extends ObjectTypeOptions<Types, NonNullable<ConnectionShapeFromResolve<Types, Type, false, false, NodeNullability, Resolved>['edges']>[number]> { | ||
interface ConnectionEdgeObjectOptions<Types extends SchemaTypes, Type extends OutputType<Types>, NodeNullability extends boolean, Resolved> extends ObjectTypeOptions<Types, NonNullable<ConnectionShapeFromResolve<Types, Type, false, false, NodeNullability, Resolved>["edges"]>[number]> { | ||
name?: string; | ||
@@ -115,2 +137,2 @@ } | ||
} | ||
//# sourceMappingURL=global-types.d.ts.map | ||
//# sourceMappingURL=global-types.d.ts.map |
@@ -1,15 +0,15 @@ | ||
import './global-types'; | ||
import './field-builder'; | ||
import './input-field-builder'; | ||
import './schema-builder'; | ||
import './global-types.js'; | ||
import './field-builder.js'; | ||
import './input-field-builder.js'; | ||
import './schema-builder.js'; | ||
import { GraphQLFieldResolver } from 'graphql'; | ||
import { BasePlugin, PothosOutputFieldConfig, SchemaTypes } from '@pothos/core'; | ||
export * from './types'; | ||
export * from './utils'; | ||
export * from './types.js'; | ||
export * from './utils/index.js'; | ||
declare const pluginName = "relay"; | ||
export default pluginName; | ||
export declare class PothosRelayPlugin<Types extends SchemaTypes> extends BasePlugin<Types> { | ||
wrapResolve(resolver: GraphQLFieldResolver<unknown, Types['Context'], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types['Context'], object>; | ||
wrapSubscribe(subscribe: GraphQLFieldResolver<unknown, Types['Context'], object> | undefined, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types['Context'], object> | undefined; | ||
wrapResolve(resolver: GraphQLFieldResolver<unknown, Types["Context"], object>, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object>; | ||
wrapSubscribe(subscribe: GraphQLFieldResolver<unknown, Types["Context"], object> | undefined, fieldConfig: PothosOutputFieldConfig<Types>): GraphQLFieldResolver<unknown, Types["Context"], object> | undefined; | ||
} | ||
//# sourceMappingURL=index.d.ts.map | ||
//# sourceMappingURL=index.d.ts.map |
export {}; | ||
//# sourceMappingURL=input-field-builder.d.ts.map | ||
//# sourceMappingURL=input-field-builder.d.ts.map |
import { ObjectRef, SchemaTypes } from '@pothos/core'; | ||
import { ConnectionShape } from './types'; | ||
export declare const connectionRefs: WeakMap<PothosSchemaTypes.SchemaBuilder<SchemaTypes>, ObjectRef<ConnectionShape<SchemaTypes, unknown, boolean, import("@pothos/core").FieldNullability<[unknown]>, boolean>, ConnectionShape<SchemaTypes, unknown, boolean, import("@pothos/core").FieldNullability<[unknown]>, boolean>>[]>; | ||
import { ConnectionShape } from './types.js'; | ||
export declare const connectionRefs: WeakMap<PothosSchemaTypes.SchemaBuilder<SchemaTypes>, ObjectRef<ConnectionShape<SchemaTypes, unknown, boolean, import("@pothos/core").FieldNullability<[ | ||
unknown | ||
]>, boolean>, ConnectionShape<SchemaTypes, unknown, boolean, import("@pothos/core").FieldNullability<[ | ||
unknown | ||
]>, boolean>>[]>; | ||
export declare const globalConnectionFieldsMap: WeakMap<PothosSchemaTypes.SchemaBuilder<SchemaTypes>, ((ref: ObjectRef<ConnectionShape<SchemaTypes, unknown, boolean>>) => void)[]>; | ||
//# sourceMappingURL=schema-builder.d.ts.map | ||
//# sourceMappingURL=schema-builder.d.ts.map |
@@ -5,41 +5,43 @@ import { GraphQLResolveInfo } from 'graphql'; | ||
idFieldName?: string; | ||
idFieldOptions?: Partial<Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, 'ID', boolean, {}, PageInfoShape>, 'args' | 'resolve' | 'type' | 'nullable'>>; | ||
clientMutationId?: 'omit' | 'optional' | 'required'; | ||
cursorType?: 'ID' | 'String'; | ||
idFieldOptions?: Partial<Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, "ID", boolean, {}, PageInfoShape>, "args" | "resolve" | "type" | "nullable">>; | ||
clientMutationId?: "omit" | "optional" | "required"; | ||
cursorType?: "ID" | "String"; | ||
brandLoadedObjects?: boolean; | ||
nodeTypeOptions: Omit<PothosSchemaTypes.InterfaceTypeOptions<Types, unknown>, 'fields'>; | ||
pageInfoTypeOptions: Omit<PothosSchemaTypes.ObjectTypeOptions<Types, PageInfoShape>, 'fields'>; | ||
nodeTypeOptions: Omit<PothosSchemaTypes.InterfaceTypeOptions<Types, unknown>, "fields">; | ||
pageInfoTypeOptions: Omit<PothosSchemaTypes.ObjectTypeOptions<Types, PageInfoShape>, "fields">; | ||
nodeQueryOptions: Omit<PothosSchemaTypes.QueryFieldOptions<Types, OutputRefShape<GlobalIDShape<Types> | string>, boolean, { | ||
id: InputFieldRef<InputShape<Types, 'ID'>>; | ||
}, Promise<unknown>>, 'args' | 'resolve' | 'type'>; | ||
id: InputFieldRef<InputShape<Types, "ID">>; | ||
}, Promise<unknown>>, "args" | "resolve" | "type">; | ||
nodesQueryOptions: Omit<PothosSchemaTypes.QueryFieldOptions<Types, [ | ||
OutputRefShape<GlobalIDShape<Types> | string> | ||
], FieldNullability<[unknown]>, { | ||
ids: InputFieldRef<InputShape<Types, 'ID'>[]>; | ||
}, Promise<unknown>[]>, 'args' | 'resolve' | 'type'>; | ||
mutationInputArgOptions: Omit<PothosSchemaTypes.ArgFieldOptions<Types, InputRef<{}>, boolean>, 'fields' | 'type'>; | ||
clientMutationIdInputOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, 'ID', boolean>, 'type'>; | ||
clientMutationIdFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, 'ID', boolean, {}, Types['Scalars']['ID']['Output']>, 'args' | 'resolve' | 'type'>; | ||
cursorFieldOptions: Normalize<Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, 'ID' | 'String', false, {}, Types['Scalars']['ID' | 'String']['Output']>, 'args' | 'resolve' | 'type'> & { | ||
type?: 'ID' | 'String'; | ||
], FieldNullability<[ | ||
unknown | ||
]>, { | ||
ids: InputFieldRef<InputShape<Types, "ID">[]>; | ||
}, Promise<unknown>[]>, "args" | "resolve" | "type">; | ||
mutationInputArgOptions: Omit<PothosSchemaTypes.ArgFieldOptions<Types, InputRef<{}>, boolean>, "fields" | "type">; | ||
clientMutationIdInputOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, "ID", boolean>, "type">; | ||
clientMutationIdFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, "ID", boolean, {}, Types["Scalars"]["ID"]["Output"]>, "args" | "resolve" | "type">; | ||
cursorFieldOptions: Normalize<Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, "ID" | "String", false, {}, Types["Scalars"]["ID" | "String"]["Output"]>, "args" | "resolve" | "type"> & { | ||
type?: "ID" | "String"; | ||
}>; | ||
nodeFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, ObjectRef<{}>, Types['DefaultNodeNullability'], {}, GlobalIDShape<Types> | string>, 'args' | 'nullable' | 'resolve' | 'type'> & { | ||
nullable?: Types['DefaultNodeNullability']; | ||
nodeFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, ObjectRef<{}>, Types["DefaultNodeNullability"], {}, GlobalIDShape<Types> | string>, "args" | "nullable" | "resolve" | "type"> & { | ||
nullable?: Types["DefaultNodeNullability"]; | ||
}; | ||
edgesFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, [ | ||
ObjectRef<{}> | ||
], Types['DefaultEdgesNullability'], {}, unknown[]>, 'args' | 'resolve' | 'nullable' | 'type'> & { | ||
nullable?: Types['DefaultEdgesNullability']; | ||
], Types["DefaultEdgesNullability"], {}, unknown[]>, "args" | "resolve" | "nullable" | "type"> & { | ||
nullable?: Types["DefaultEdgesNullability"]; | ||
}; | ||
pageInfoFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, OutputRef<PageInfoShape>, boolean, {}, PageInfoShape>, 'args' | 'resolve' | 'type'>; | ||
hasNextPageFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, PageInfoShape, 'Boolean', boolean, {}, boolean>, 'args' | 'resolve' | 'type'>; | ||
hasPreviousPageFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, PageInfoShape, 'Boolean', boolean, {}, boolean>, 'args' | 'resolve' | 'type'>; | ||
startCursorFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, PageInfoShape, 'ID' | 'String', boolean, {}, string | null>, 'args' | 'resolve' | 'type'>; | ||
endCursorFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, PageInfoShape, 'ID' | 'String', boolean, {}, string | null>, 'args' | 'resolve' | 'type'>; | ||
beforeArgOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, 'ID' | 'String', boolean>, 'required' | 'type'>; | ||
afterArgOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, 'ID' | 'String', boolean>, 'required' | 'type'>; | ||
firstArgOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, 'Int', boolean>, 'required' | 'type'>; | ||
lastArgOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, 'Int', boolean>, 'required' | 'type'>; | ||
encodeGlobalID?: (typename: string, id: bigint | number | string, ctx: Types['Context']) => string; | ||
decodeGlobalID?: (globalID: string, ctx: Types['Context']) => { | ||
pageInfoFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, OutputRef<PageInfoShape>, boolean, {}, PageInfoShape>, "args" | "resolve" | "type">; | ||
hasNextPageFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, PageInfoShape, "Boolean", boolean, {}, boolean>, "args" | "resolve" | "type">; | ||
hasPreviousPageFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, PageInfoShape, "Boolean", boolean, {}, boolean>, "args" | "resolve" | "type">; | ||
startCursorFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, PageInfoShape, "ID" | "String", boolean, {}, string | null>, "args" | "resolve" | "type">; | ||
endCursorFieldOptions: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, PageInfoShape, "ID" | "String", boolean, {}, string | null>, "args" | "resolve" | "type">; | ||
beforeArgOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, "ID" | "String", boolean>, "required" | "type">; | ||
afterArgOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, "ID" | "String", boolean>, "required" | "type">; | ||
firstArgOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, "Int", boolean>, "required" | "type">; | ||
lastArgOptions: Omit<PothosSchemaTypes.InputObjectFieldOptions<Types, "Int", boolean>, "required" | "type">; | ||
encodeGlobalID?: (typename: string, id: bigint | number | string, ctx: Types["Context"]) => string; | ||
decodeGlobalID?: (globalID: string, ctx: Types["Context"]) => { | ||
typename: string; | ||
@@ -54,4 +56,4 @@ id: string; | ||
defaultPayloadTypeOptions: Partial<PothosSchemaTypes.ObjectTypeOptions<Types, {}>>; | ||
defaultMutationInputTypeOptions: Partial<Omit<PothosSchemaTypes.InputObjectTypeOptions<Types, {}>, 'fields'>>; | ||
defaultConnectionFieldOptions?: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, OutputRef<ConnectionShape<Types, unknown, false, true, true>>, boolean, InputFieldsFromShape<DefaultConnectionArguments>, ConnectionShape<Types, unknown, false, true, true>>, 'args' | 'resolve' | 'type'>; | ||
defaultMutationInputTypeOptions: Partial<Omit<PothosSchemaTypes.InputObjectTypeOptions<Types, {}>, "fields">>; | ||
defaultConnectionFieldOptions?: Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, OutputRef<ConnectionShape<Types, unknown, false, true, true>>, boolean, InputFieldsFromShape<DefaultConnectionArguments>, ConnectionShape<Types, unknown, false, true, true>>, "args" | "resolve" | "type">; | ||
nodesOnConnection?: boolean | Omit<PothosSchemaTypes.ObjectFieldOptions<Types, {}, [ | ||
@@ -61,4 +63,4 @@ ObjectRef<{}> | ||
list: false; | ||
items: Types['DefaultNodeNullability']; | ||
}, {}, GlobalIDShape<Types> | string>, 'args' | 'nullable' | 'resolve' | 'type'>; | ||
items: Types["DefaultNodeNullability"]; | ||
}, {}, GlobalIDShape<Types> | string>, "args" | "nullable" | "resolve" | "type">; | ||
}>; | ||
@@ -76,6 +78,8 @@ export interface DefaultEdgesNullability { | ||
export interface GlobalIDShape<Types extends SchemaTypes> { | ||
id: OutputShape<Types, 'ID'>; | ||
id: OutputShape<Types, "ID">; | ||
type: OutputType<Types> | string; | ||
} | ||
export declare type ConnectionShape<Types extends SchemaTypes, T, Nullable, EdgesNullable extends FieldNullability<[unknown]> = Types['DefaultEdgesNullability'], NodeNullable extends boolean = Types['DefaultNodeNullability']> = (Nullable extends false ? never : null | undefined) | (Types['Connection'] & { | ||
export declare type ConnectionShape<Types extends SchemaTypes, T, Nullable, EdgesNullable extends FieldNullability<[ | ||
unknown | ||
]> = Types["DefaultEdgesNullability"], NodeNullable extends boolean = Types["DefaultNodeNullability"]> = (Nullable extends false ? never : null | undefined) | (Types["Connection"] & { | ||
pageInfo: PageInfoShape; | ||
@@ -90,4 +94,8 @@ edges: ShapeFromListTypeParam<Types, [ | ||
export declare type ConnectionShapeFromBaseShape<Types extends SchemaTypes, Shape, Nullable extends boolean> = ConnectionShape<Types, Shape, Nullable>; | ||
export declare type ConnectionShapeForType<Types extends SchemaTypes, Type extends OutputType<Types>, Nullable extends boolean, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean> = ConnectionShape<Types, ShapeFromTypeParam<Types, Type, false>, Nullable, EdgeNullability, NodeNullability>; | ||
export declare type ConnectionShapeFromResolve<Types extends SchemaTypes, Type extends OutputType<Types>, Nullable extends boolean, EdgeNullability extends FieldNullability<[unknown]>, NodeNullability extends boolean, Resolved> = Resolved extends Promise<infer T> ? NonNullable<T> extends ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability> ? NonNullable<T> : ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability> : Resolved extends ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability> ? NonNullable<Resolved> : ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability>; | ||
export declare type ConnectionShapeForType<Types extends SchemaTypes, Type extends OutputType<Types>, Nullable extends boolean, EdgeNullability extends FieldNullability<[ | ||
unknown | ||
]>, NodeNullability extends boolean> = ConnectionShape<Types, ShapeFromTypeParam<Types, Type, false>, Nullable, EdgeNullability, NodeNullability>; | ||
export declare type ConnectionShapeFromResolve<Types extends SchemaTypes, Type extends OutputType<Types>, Nullable extends boolean, EdgeNullability extends FieldNullability<[ | ||
unknown | ||
]>, NodeNullability extends boolean, Resolved> = Resolved extends Promise<infer T> ? NonNullable<T> extends ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability> ? NonNullable<T> : ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability> : Resolved extends ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability> ? NonNullable<Resolved> : ConnectionShapeForType<Types, Type, Nullable, EdgeNullability, NodeNullability>; | ||
export interface DefaultConnectionArguments extends PothosSchemaTypes.DefaultConnectionArguments { | ||
@@ -97,21 +105,27 @@ } | ||
export declare type NodeObjectOptions<Types extends SchemaTypes, Param extends ObjectParam<Types>, Interfaces extends InterfaceParam<Types>[]> = NodeBaseObjectOptionsForParam<Types, Param, Interfaces> & { | ||
id: Omit<FieldOptionsFromKind<Types, ParentShape<Types, Param>, 'ID', false, {}, 'Object', OutputShape<Types, 'ID'>, MaybePromise<OutputShape<Types, 'ID'>>>, 'args' | 'nullable' | 'type'>; | ||
id: Omit<FieldOptionsFromKind<Types, ParentShape<Types, Param>, "ID", false, {}, "Object", OutputShape<Types, "ID">, MaybePromise<OutputShape<Types, "ID">>>, "args" | "nullable" | "type">; | ||
brandLoadedObjects?: boolean; | ||
loadOne?: (id: string, context: Types['Context']) => MaybePromise<OutputShape<Types, Param> | null | undefined>; | ||
loadMany?: (ids: string[], context: Types['Context']) => MaybePromise<MaybePromise<OutputShape<Types, Param> | null | undefined>[]>; | ||
loadWithoutCache?: (id: string, context: Types['Context'], info: GraphQLResolveInfo) => MaybePromise<OutputShape<Types, Param> | null | undefined>; | ||
loadManyWithoutCache?: (ids: string[], context: Types['Context']) => MaybePromise<MaybePromise<OutputShape<Types, Param> | null | undefined>[]>; | ||
loadOne?: (id: string, context: Types["Context"]) => MaybePromise<OutputShape<Types, Param> | null | undefined>; | ||
loadMany?: (ids: string[], context: Types["Context"]) => MaybePromise<MaybePromise<OutputShape<Types, Param> | null | undefined>[]>; | ||
loadWithoutCache?: (id: string, context: Types["Context"], info: GraphQLResolveInfo) => MaybePromise<OutputShape<Types, Param> | null | undefined>; | ||
loadManyWithoutCache?: (ids: string[], context: Types["Context"]) => MaybePromise<MaybePromise<OutputShape<Types, Param> | null | undefined>[]>; | ||
}; | ||
export declare type GlobalIDFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, Nullable extends boolean, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, 'ID', Nullable, Args, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> & { | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, OutputRefShape<GlobalIDShape<Types> | string>, true>, ResolveReturnShape>; | ||
export declare type GlobalIDFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, Nullable extends boolean, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, "ID", Nullable, Args, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> & { | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, OutputRefShape<GlobalIDShape<Types> | string>, true>, ResolveReturnShape>; | ||
}; | ||
export declare type GlobalIDInputFieldOptions<Types extends SchemaTypes, Req extends boolean, Kind extends 'Arg' | 'InputObject'> = Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, 'ID', Req>[Kind], 'type'>; | ||
export declare type GlobalIDListInputFieldOptions<Types extends SchemaTypes, Req extends FieldRequiredness<['ID']>, Kind extends 'Arg' | 'InputObject'> = Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, ['ID'], Req>[Kind], 'type'>; | ||
export declare type NodeIDFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, Nullable extends boolean, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, 'ID', Nullable, Args, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> & { | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, OutputRefShape<GlobalIDShape<Types> | string>, true>, ResolveReturnShape>; | ||
export declare type GlobalIDInputFieldOptions<Types extends SchemaTypes, Req extends boolean, Kind extends "Arg" | "InputObject"> = Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, "ID", Req>[Kind], "type">; | ||
export declare type GlobalIDListInputFieldOptions<Types extends SchemaTypes, Req extends FieldRequiredness<[ | ||
"ID" | ||
]>, Kind extends "Arg" | "InputObject"> = Omit<PothosSchemaTypes.InputFieldOptionsByKind<Types, [ | ||
"ID" | ||
], Req>[Kind], "type">; | ||
export declare type NodeIDFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, Nullable extends boolean, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, "ID", Nullable, Args, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> & { | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, OutputRefShape<GlobalIDShape<Types> | string>, true>, ResolveReturnShape>; | ||
}; | ||
export declare type GlobalIDListFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, Nullable extends FieldNullability<[unknown]>, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
'ID' | ||
], Nullable, Args, Kind, ParentShape, ResolveReturnShape>, 'resolve' | 'type'> & { | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, [ | ||
export declare type GlobalIDListFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, Nullable extends FieldNullability<[ | ||
unknown | ||
]>, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
"ID" | ||
], Nullable, Args, Kind, ParentShape, ResolveReturnShape>, "resolve" | "type"> & { | ||
resolve: Resolver<ParentShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, [ | ||
OutputRefShape<GlobalIDShape<Types> | string> | ||
@@ -123,4 +137,4 @@ ], { | ||
}; | ||
export declare type NodeFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, OutputRefShape<GlobalIDShape<Types> | string>, true, Args, Kind, ParentShape, ResolveReturnShape>, 'nullable' | 'resolve' | 'type'> & { | ||
id: Resolver<ParentShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, OutputRefShape<GlobalIDShape<Types> | string>, true>, ResolveReturnShape>; | ||
export declare type NodeFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, OutputRefShape<GlobalIDShape<Types> | string>, true, Args, Kind, ParentShape, ResolveReturnShape>, "nullable" | "resolve" | "type"> & { | ||
id: Resolver<ParentShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, OutputRefShape<GlobalIDShape<Types> | string>, true>, ResolveReturnShape>; | ||
}; | ||
@@ -132,4 +146,4 @@ export declare type NodeListFieldOptions<Types extends SchemaTypes, ParentShape, Args extends InputFieldMap, ResolveReturnShape, Kind extends FieldKind = FieldKind> = Omit<FieldOptionsFromKind<Types, ParentShape, [ | ||
items: true; | ||
}, Args, Kind, ParentShape, ResolveReturnShape>, 'nullable' | 'resolve' | 'type'> & { | ||
ids: Resolver<ParentShape, InputShapeFromFields<Args>, Types['Context'], ShapeFromTypeParam<Types, [ | ||
}, Args, Kind, ParentShape, ResolveReturnShape>, "nullable" | "resolve" | "type"> & { | ||
ids: Resolver<ParentShape, InputShapeFromFields<Args>, Types["Context"], ShapeFromTypeParam<Types, [ | ||
OutputRefShape<GlobalIDShape<Types> | string> | ||
@@ -147,11 +161,11 @@ ], { | ||
} | ||
export declare type RelayMutationInputOptions<Types extends SchemaTypes, Fields extends InputFieldMap, InputName extends string> = Omit<PothosSchemaTypes.InputObjectTypeOptions<Types, Fields>, 'fields'> & { | ||
export declare type RelayMutationInputOptions<Types extends SchemaTypes, Fields extends InputFieldMap, InputName extends string> = Omit<PothosSchemaTypes.InputObjectTypeOptions<Types, Fields>, "fields"> & { | ||
name?: string; | ||
argName?: InputName; | ||
inputFields: (t: PothosSchemaTypes.InputFieldBuilder<Types, 'InputObject'>) => Fields; | ||
inputFields: (t: PothosSchemaTypes.InputFieldBuilder<Types, "InputObject">) => Fields; | ||
}; | ||
export declare type RelayMutationFieldOptions<Types extends SchemaTypes, Fields extends InputFieldMap, Nullable extends boolean, InputName extends string, ResolveShape, ResolveReturnShape> = Omit<FieldOptionsFromKind<Types, Types['Root'], OutputRef<ResolveShape>, Nullable, { | ||
export declare type RelayMutationFieldOptions<Types extends SchemaTypes, Fields extends InputFieldMap, Nullable extends boolean, InputName extends string, ResolveShape, ResolveReturnShape> = Omit<FieldOptionsFromKind<Types, Types["Root"], OutputRef<ResolveShape>, Nullable, { | ||
[K in InputName]: InputFieldRef<InputShapeWithClientMutationId<Types, Fields>>; | ||
}, 'Mutation', ResolveShape, ResolveReturnShape>, 'args' | 'type'>; | ||
export declare type RelayMutationPayloadOptions<Types extends SchemaTypes, Shape, Interfaces extends InterfaceParam<Types>[]> = Omit<PothosSchemaTypes.ObjectTypeOptions<Types, Shape> | PothosSchemaTypes.ObjectTypeWithInterfaceOptions<Types, Shape, Interfaces>, 'fields'> & { | ||
}, "Mutation", ResolveShape, ResolveReturnShape>, "args" | "type">; | ||
export declare type RelayMutationPayloadOptions<Types extends SchemaTypes, Shape, Interfaces extends InterfaceParam<Types>[]> = Omit<PothosSchemaTypes.ObjectTypeOptions<Types, Shape> | PothosSchemaTypes.ObjectTypeWithInterfaceOptions<Types, Shape, Interfaces>, "fields"> & { | ||
name?: string; | ||
@@ -161,4 +175,4 @@ outputFields: ObjectFieldsShape<Types, Shape>; | ||
export declare type InputShapeWithClientMutationId<Types extends SchemaTypes, Fields extends InputFieldMap> = InputShapeFromFields<Fields & { | ||
clientMutationId: InputFieldRef<Types['Scalars']['ID']['Input']>; | ||
clientMutationId: InputFieldRef<Types["Scalars"]["ID"]["Input"]>; | ||
}>; | ||
//# sourceMappingURL=types.d.ts.map | ||
//# sourceMappingURL=types.d.ts.map |
import { MaybePromise, SchemaTypes } from '@pothos/core'; | ||
import { ConnectionShape, DefaultConnectionArguments } from '../types'; | ||
import { ConnectionShape, DefaultConnectionArguments } from '../types.js'; | ||
interface ResolveOffsetConnectionOptions { | ||
@@ -41,2 +41,2 @@ args: DefaultConnectionArguments; | ||
export {}; | ||
//# sourceMappingURL=connections.d.ts.map | ||
//# sourceMappingURL=connections.d.ts.map |
@@ -6,2 +6,2 @@ export declare function encodeGlobalID(typename: string, id: bigint | number | string): string; | ||
}; | ||
//# sourceMappingURL=global-ids.d.ts.map | ||
//# sourceMappingURL=global-ids.d.ts.map |
@@ -1,5 +0,5 @@ | ||
export * from './connections'; | ||
export * from './global-ids'; | ||
export * from './resolve-nodes'; | ||
export * from './connections.js'; | ||
export * from './global-ids.js'; | ||
export * from './resolve-nodes.js'; | ||
export declare function capitalize(s: string): string; | ||
//# sourceMappingURL=index.d.ts.map | ||
//# sourceMappingURL=index.d.ts.map |
@@ -7,2 +7,2 @@ import { SchemaTypes } from '@pothos/core'; | ||
}; | ||
//# sourceMappingURL=internal.d.ts.map | ||
//# sourceMappingURL=internal.d.ts.map |
@@ -5,2 +5,2 @@ import { GraphQLResolveInfo } from 'graphql'; | ||
export declare function resolveUncachedNodesForType<Types extends SchemaTypes>(builder: PothosSchemaTypes.SchemaBuilder<Types>, context: object, info: GraphQLResolveInfo, ids: string[], type: OutputType<Types> | string): Promise<unknown[]>; | ||
//# sourceMappingURL=resolve-nodes.d.ts.map | ||
//# sourceMappingURL=resolve-nodes.d.ts.map |
{ | ||
"name": "@pothos/plugin-relay", | ||
"version": "3.28.2", | ||
"version": "3.28.3", | ||
"description": "A Pothos plugin for adding relay style connections, nodes, and cursor based pagination to your GraphQL schema", | ||
@@ -43,5 +43,5 @@ "main": "./lib/index.js", | ||
"devDependencies": { | ||
"@pothos/core": "3.22.2", | ||
"@pothos/plugin-complexity": "3.11.2", | ||
"@pothos/test-utils": "1.4.1", | ||
"@pothos/core": "3.22.4", | ||
"@pothos/plugin-complexity": "3.11.3", | ||
"@pothos/test-utils": "1.4.2", | ||
"graphql": "16.6.0", | ||
@@ -60,4 +60,4 @@ "graphql-subscriptions": "^2.0.0", | ||
"esm:extensions": "TS_NODE_PROJECT=../../tsconfig.json node -r @swc-node/register ../../scripts/esm-transformer.ts", | ||
"test": "pnpm vitest --run" | ||
"test": "pnpm vitest --run --segfault-retry=3" | ||
} | ||
} |
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
377805
4667