The suffix to append to the GraphQL Type name, default is an underscore, override this property in your sub-class to change the suffix
Build one GraphQL server file — a single schema, or the legacy monolith when per-schema emit is turned off.
ProtectedemitDelegates so both generators write identically; override to change that.
ProtectedgenerateGenerates import statements for entity classes, grouping by package when entityPackageName is a schema-to-package map.
Optionaloptions: SchemaEmitOptionsProtectedgenerateEmits the field-security transport field onto every generated object type.
Present on ALL entities, not just those with EnableFieldLevelSecurity — the schema is a
build artifact and that flag is runtime metadata an administrator can toggle in Explorer, so
a schema whose SHAPE depended on it would be silently wrong the moment someone flipped it
without re-running CodeGen. It is nullable and the server leaves it null for unrestricted
callers, so it costs nothing on the overwhelming majority of requests.
See ReadableFieldsTransportKey for what it carries and why it names readable rather than denied fields.
ProtectedgenerateProtectedgenerateProtectedgenerateProtectedgenerateProtectedgenerateProtectedgenerateProtectedgenerateProtectedgetGenerates the full server GraphQL type name for an entity (with suffix).
The entity to generate the type name for
The full GraphQL type name (with suffix)
ProtectedgetGenerates 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.
The entity to generate the type name for
The base GraphQL type name (without suffix)
ProtectedgetMaps 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.
ProtectedisWhether an OUTPUT-type field may be marked non-nullable in the generated GraphQL schema.
The rule is deliberately NOT AllowsNull. A column's NOT NULL constraint and a GraphQL
field's ! say different things:
String! — every RESPONSE, to every caller, carries a value for this field.The second does not follow from the first. It only coincided while every caller saw every
column of every row they could read. Field-level security ends that: a denied field is
OMITTED from the response (ResolverBase.MapFieldNamesToCodeNames), and GraphQL treats an
absent value on a non-nullable field as an error that propagates up to the nearest nullable
parent — nulling the whole record on a single-record load, the whole query on a typed list,
and failing the mutation RESPONSE after the write already landed.
So presence is promised only where FLS is structurally incapable of stripping the field:
primary keys (hard and soft) and __mj_ system columns — exactly
EntityFieldInfo.IsUnrestrictableField, the same predicate the runtime aggregation and
the save-time guard use. Anything else can legitimately be absent for SOME caller, so the
schema must not promise otherwise.
INPUT types are unaffected and keep deriving from AllowsNull — they carry the WRITE
contract, which the database constraint does still govern.
ProtectedresolveDelegates so both generators share one set of defaults; override to change them.
Optionaloptions: SchemaEmitOptionsProtectedschemaReturns 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.
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.