naystack - v1.9.9
    Preparing search index...

    Interface FieldResolverDefinition

    Full field resolver definition returned by field. Contains the resolver function, plus .call() and .authCall() for direct server-side invocation.

    interface FieldResolverDefinition {
        alwaysResolve?: boolean;
        authCall: (
            root: Root,
            data: ParsedGQLTypeWithNullability<U, InputNullable, false>,
        ) => Promise<AuthCallReturn<IsAuth, R>>;
        authorized?: IsAuth;
        call: (
            root: Root,
            data: ParsedGQLTypeWithNullability<U, InputNullable, false>,
        ) => Promise<AuthCallReturn<IsAuth, R>>;
        fn: (
            root: Root,
            ctx: IsAuth extends true ? AuthorizedContext : Context,
            data: ParsedGQLTypeWithNullability<U, InputNullable, false>,
        ) => R;
        input?: U;
        inputOptions?: DecoratorTypeOptions & DescriptionOptions & ValidateOptions & DeprecationOptions & {
            nullable: InputNullable;
        };
        output: T;
        outputOptions?: DecoratorTypeOptions & DescriptionOptions & DeprecationOptions & SchemaNameOptions & ComplexityOptions & {
            nullable: OutputNullable;
        };
    }

    Hierarchy

    • BaseDefinition<T, U, IsAuth, OutputNullable, InputNullable>
      • FieldResolverDefinition
    Index

    Properties

    alwaysResolve?: boolean

    Skip FieldLibrary's short-circuit, which returns a pre-hydrated root[key] without ever calling this resolver.

    Set this on any field that gates on ctx — an auth check inside the resolver is silently bypassed the moment a parent query selects the field's value into its own columns. The resolver stays responsible for reusing root[key] when present, so hydration still avoids the N+1.

    authCall: (
        root: Root,
        data: ParsedGQLTypeWithNullability<U, InputNullable, false>,
    ) => Promise<AuthCallReturn<IsAuth, R>>

    Calls the field resolver server-side with authentication (always reads the refresh cookie). Resolves to null when authorized: true and there is no session.

    authorized?: IsAuth
    call: (
        root: Root,
        data: ParsedGQLTypeWithNullability<U, InputNullable, false>,
    ) => Promise<AuthCallReturn<IsAuth, R>>

    Calls the field resolver server-side. For authorized fields, reads the refresh cookie. Resolves to null when authorized: true and there is no session.

    fn: (
        root: Root,
        ctx: IsAuth extends true ? AuthorizedContext : Context,
        data: ParsedGQLTypeWithNullability<U, InputNullable, false>,
    ) => R
    input?: U
    inputOptions?: DecoratorTypeOptions & DescriptionOptions & ValidateOptions & DeprecationOptions & {
        nullable: InputNullable;
    }
    output: T
    outputOptions?: DecoratorTypeOptions & DescriptionOptions & DeprecationOptions & SchemaNameOptions & ComplexityOptions & {
        nullable: OutputNullable;
    }