Type Inference Challenge in Effect-HTTP Request Handler

One pain point, that i'm sure theres a solution for i'm having with effect-http is the type for my request in the handler.

If I write something like so:

RouterBuilder.handler(api, 'handler', req =>
  pipe(
    // the type here is hard to type for this function
    // I either need it to inferred or have a way of typing the request for the purposes of the fn definition.
   // How can I derive this type? Just must together my schemas with Schema.Schema.Type<typeof schema> & ...other schemas?
    checkForSetCookie(req),
    Effect.flatMap(index =>
      mapJourneyToResponse(req.query.authIndexValue, index),
    ),
  ),
);
Was this page helpful?