naystack - v1.9.9
    Preparing search index...

    Interface QueryDefinition

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

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

    Hierarchy

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

    Properties

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

    Calls the resolver server-side with authentication (always reads the refresh cookie). Use in Server Components. Resolves to null when authorized: true and there is no session — guard it, or gate the page ahead of it.

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

    Calls the resolver server-side. For authorized queries, reads the refresh cookie; for non-authorized, passes null userId. Resolves to null when authorized: true and there is no session.

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