Setu-TS
    Preparing search index...

    Interface AnySubscriptionResolver

    The entry type for a SUBSCRIPTION resolver stored in a TypeResolverMap.

    The bivariant counterpart of AnyFieldResolver, for the same reason and by the same mechanism: TypeResolverMap bound the bare SubscriptionResolver, whose defaults are all unknown, so a typed subscription entry — resolve: (payload: Book) => payload.title — was rejected under strictFunctionTypes with Type 'unknown' is not assignable to type 'Book'. That is X6-4's defect surviving on the subscription arm.

    subscribe is declared with method syntax (bivariant) and resolve reuses AnyFieldResolver, so a typed subscription assigns while an unannotated one still gets its parameters contextually. Instantiating SubscriptionResolver at never would buy the first and lose the second, which is the regression the field arm already hit.

    interface AnySubscriptionResolver {
        resolve?: (
            source: unknown,
            args: Record<string, unknown>,
            context: unknown,
            info: unknown,
        ) => unknown;
        subscribe(
            source: unknown,
            args: Record<string, unknown>,
            context: unknown,
            info: unknown,
        ):
            | AsyncIterable<unknown, any, any>
            | Promise<AsyncIterable<unknown, any, any>>;
    }
    Index
    resolve?: (
        source: unknown,
        args: Record<string, unknown>,
        context: unknown,
        info: unknown,
    ) => unknown

    Maps each emitted payload to the field value. Optional.

    • Produces the event source for this subscription field.

      Parameters

      • source: unknown
      • args: Record<string, unknown>
      • context: unknown
      • info: unknown

      Returns AsyncIterable<unknown, any, any> | Promise<AsyncIterable<unknown, any, any>>