Functions
@system-inc/base-foundation · 515c140 · 11 symbols
buildPagination
Builds the Pagination a paginated result carries.
ormPaginatedFind covers every read that is a find over an entity, which is
nearly all of them. A handful of resolvers cannot use it - a GROUP BY has no
entity to find, and a hand-written join may not map to one - and those have to
assemble this object themselves. Doing that by hand is how the shape drifts:
one existing resolver computes a zero-based page where the find layer
computes it one-based, and none of them populate the next/previous cursors at
all, so a client cannot tell those results apart from a single-page one.
So the arithmetic lives here and both paths call it. A resolver still runs its
own LIMIT/OFFSET and its own COUNT; it just does not get to invent what
the numbers around them mean.
claimPaginationInputBaseName
Claims a generated name prefix for a declaration. Called last by
@PaginationInputFor, so only a declaration that fully succeeded owns its
generated names.
getAllPaginationInputMetadata
All declared pagination inputs — consumed by base check tooling.
getPaginationInputBaseNameOwner
The class currently owning a generated name prefix, or undefined if the
prefix is unclaimed.
getPaginationInputMetadata
Resolve the declared pagination metadata for an input class, walking the prototype chain so a subclass of a declared input inherits its contract.
gqlBuildSchema
Build a GraphQL schema from a GqlConfiguration.
Shared primitive for any GqlServerProvider that uses type-graphql. Lives at the foundation level (not inside a specific provider) so other providers — Apollo, Mercurius, etc. — can reuse the same DI/validation/ middleware wiring.
gqlMaskError
gqlOperationContextKey
The context-bag key a resolver's GqlOperationContext is stored under, derived from the field's response path so it is unique per field invocation.
Keying by the resolver method (Class.method) would collide when a
document aliases the same field twice — a: user{name} b: user{email} —
making both invocations read the last one's selection set. The response
path (a, b, parent.child, …) is unique per field. Namespaced so a
field aliased operations/request can't clobber a real GqlContext
property.
orderByDirectionToSql
orderByInputToFindOptionsOrder
recordPaginationInputMetadata
Records what a declaration resolved to. Called by @PaginationInputFor
once the declaration has been fully validated.