Member Junction
    Preparing search index...

    This class is responsible for generating the GraphQL Server resolvers and types for the entities, you can sub-class this class to extend/modify the logic, make sure to use @memberjunction/global RegisterClass decorator so that your class is used.

    Index

    Constructors

    Properties

    _graphQLTypeSuffix: string = '_'

    Accessors

    Methods

    • Generates import statements for entity classes, grouping by package when entityPackageName is a schema-to-package map.

      Parameters

      • entities: EntityInfo[]
      • defaultLibrary: string
      • isInternal: boolean

      Returns string

    • Parameters

      • entities: EntityInfo[]
      • outputDirectory: string
      • generatedEntitiesImportLibrary: string
      • excludeRelatedEntitiesExternalToSchema: boolean

      Returns boolean

    • Parameters

      • entity: EntityInfo
      • includeFileHeader: boolean
      • generatedEntitiesImportLibrary: string
      • excludeRelatedEntitiesExternalToSchema: boolean

      Returns string

    • Parameters

      • entity: EntityInfo
      • serverGraphQLTypeName: string
      • excludeRelatedEntitiesExternalToSchema: boolean
      • isInternal: boolean

      Returns string

    • Generates the base GraphQL type name for an entity using SchemaBaseTable pattern. Preserves original capitalization. Special case: MJ core schema uses "MJ" prefix. This ensures unique type names across different schemas.

      Parameters

      • entity: EntityInfo

        The entity to generate the type name for

      Returns string

      The base GraphQL type name (without suffix)

    • Maps a column's SQL type to the TypeGraphQL @Field(...) type-fn argument.

      Categories that emit an empty string fall through to TypeGraphQL's automatic inference based on the field's TypeScript type — appropriate for string, Date, and binary-as-string columns. Boolean / Float require an explicit type fn, and anything else defaults to Int.

      The category checks come from @memberjunction/sql-dialect so that the list of recognized type names lives in exactly one place per category.

      Parameters

      Returns string

    • Returns a JavaScript expression string (for use in generated code) that resolves to the schema name at runtime. Core schema uses the dynamic config lookup; non-core schemas use a literal string.

      Parameters

      Returns string