github graphile/crystal graphile-build-pg@5.2.0

Minor Changes

  • #3172
    ead97bc
    Thanks @benjie! - build.getGraphQLTypeByPgCodec
    now reflects input/output type based on variant; manual narrowing is no longer
    required.

  • #3192
    e8709d1
    Thanks @benjie! - PgExecutor now groups similar
    queries and runs them through the same connection, reducing the overhead from
    multiple transaction handshakes and making better use of prepared statements
    and similar optimizations. Reduces both parallelism and overhead, hopefully
    netting an overall performance win with some potential per-request latency
    trade-offs.

  • #3173
    c7dfb07
    Thanks @benjie! - Fixed @returntype for functions
    returning setof (for lists and connections) - thanks @tsnobip!

  • #3122
    7d10815
    Thanks @benjie! - Improves types in
    @dataplan/pg around codecs, resources, nullability, range values, and
    resource execution arguments. Adds support for PostGraphile Pro (V5) type
    generation.

    NOTE: pgResource.execute(...) no longer accepts pgCodec in the
    arguments; it was always ignored internally because the parameter codec was
    used, now we explicitly don't accept it. { step, name?, pgCodec } →
    { step, name? }

    The new PostGraphile Pro (V5) plugin can generate registry, plan resolver,
    introspection (for smart tags) and other related types, and even supports
    correct types across multiple PostGraphile schemas in the same TypeScript
    environment. The generated-schema-aware types provide checked schema names,
    tables, fields, arguments, nullability, and PostgreSQL resource types where
    available, while preserving broad fallbacks when they are not.

    With this plugin, many of the standard PostGraphile APIs can become more
    strongly typed with minimal user input. If you only have one PostGraphile
    instance then using the default generation should be picked up automatically
    by most plugin helpers -- extendSchema(), wrapPlans() (for the
    filter-based form of wrapPlans(), pass the scope property to options
    rather than adding a generic, this allows the filter return type to still be
    inferred automatically), pgSmartTags(), changeNullability(),
    addPgTableCondition(), addPgTableOrderBy() -- and for manual plugins you
    can use the scopedPlugin(...) helper to define your plugin. If you run
    multiple schemas then you can pass a generic (e.g.
    extendSchema<"public-api">(...)) to indicate the types to use.

  • #3138
    3953e87
    Thanks @benjie! - Slightly more stable ordering
    is used in schema construction, to make schemas ordering more stable. (Sadly,
    introducing this is likely to change the order of your schema.)

Patch Changes

  • #3109
    e991bd8
    Thanks @benjaie! - Add groundwork for modified
    PostgreSQL codecs keyed by type modifier and constraints, including base-codec
    relationships for GraphQL type resolution.

  • #3173
    901c0d1
    Thanks @benjie! - Fixes bug in "Reads and enables
    pagination through a set of ..." message (Int4 -> Int, Int8 -> BigInt, honours
    inflection for types, etc)

  • #3193
    261078d
    Thanks @benjie! - Don't pollute exports with a
    new setting unless it's set

  • #3132
    ce7a395
    Thanks @copilot-swe-agent! -
    Remove stripInternal from the shared TypeScript compiler options.
    Previously, symbols tagged with /** @internal */ were stripped from the
    generated .d.ts declaration files; they will now be included. This makes
    internal APIs visible in TypeScript but does not change any runtime behaviour.

  • #3163
    92b3ddf
    Thanks @benjie! - pgFieldResource is now set on
    the scope of more fields by PgCustomTypeFieldPlugin (making extension easier).

  • #3172
    18bbd00
    Thanks @benjie! - build.getTypeMetaByName now
    returns a TypeScript union of TypeMeta that differentiates over
    {kind: "OBJECT" | "INTERFACE" | "UNION" | "SCALAR" | "ENUM" | "INPUT_OBJECT", ...},
    allowing you to get a typed scope by simply asserting the typeMeta.kind
    you're expecting.

  • Updated dependencies
    [ce7a395]:

    • graphile-config@1.1.2
    • pg-introspection@1.0.2
    • pg-sql2@5.0.2

Don't miss a new crystal release

NewReleases is sending notifications on new releases.