Member Junction
    Preparing search index...

    Class BaseServerMiddlewareAbstract

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    • Optional escape hatch for advanced Express app configuration. Called once during server setup with the Express app instance. Use for: trust proxy settings, custom CORS, body parser config. Return undefined to skip (default).

      Parameters

      • app: Application

      Returns void | Promise<void>

    • Express middleware that runs AFTER authentication has resolved UserInfo. The authenticated user payload is available at req.userPayload. Use for: tenant context resolution, org membership loading.

      Returns RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>[]

    • Express middleware/error handlers applied AFTER all routes. Use for: catch-all error handlers, response logging.

      Returns (
          | RequestHandler<
              ParamsDictionary,
              any,
              any,
              ParsedQs,
              Record<string, any>,
          >
          | ErrorRequestHandler<
              ParamsDictionary,
              any,
              any,
              ParsedQs,
              Record<string, any>,
          >
      )[]

    • Express middleware applied BEFORE authentication. Runs after compression but before OAuth/REST/GraphQL routes. Use for: rate limiting, request logging, custom headers.

      Returns RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>[]

    • Additional TypeGraphQL resolver glob paths to include in the Apollo schema. serve() collects these from all active middleware and adds them to the resolvers array passed to buildSchema().

      Return absolute glob paths (use path.join(__dirname, ...) or equivalent).

      Use for: Open App resolvers, domain-specific GraphQL queries/mutations that live outside MJServer's built-in resolver set.

      Returns string[]

      GetResolverPaths(): string[] {
      return [path.join(__dirname, 'resolvers', '*Resolver.{js,ts}')];
      }
    • Schema transformers applied after built-in directive transformers. Use for: custom directives, schema stitching, field-level auth.

      Returns ((schema: GraphQLSchema) => GraphQLSchema)[]