github graphile/crystal graphile-build@5.0.0

graphile-build

5.0.0-rc.6

Patch Changes

  • #2990
    5d408bd
    Thanks @benjie! - No code changes. Updates the
    release process, cleans up package.json, uses fixed identifiers for peer
    dependencies (unless they're explicit dependencies also). Hopefully move to
    trusted publishing.
  • Updated dependencies
    [5d408bd]:
    • graphile-config@1.0.0-rc.6
    • tamedevil@0.1.0-rc.6

5.0.0-rc.5

Patch Changes

  • #2957
    5615d3f
    Thanks @benjie! - Significantly reduce the size
    of a PostGraphile exported schema (around 20% reduction on test fixtures) by:

    • marking optional things as optional
    • excluding many optional things from being specified in configuration objects
      (including tags objects if no tags are present)
    • using LIST_TYPES for PostgreSQL builtin list types
    • extracting inline function definitions to be global functions where
      appropriate, and simplifying functions where not

    Breaking changes to types (but more accurate reflection of reality):

    • extensions is now marked as optional in many places.
    • extensions.tags is now marked optional in many places.
    • PgCodecAttribute.notNull is now marked as optional.
    • PgResourceParameter.requires is now marked as optional.
    • PgCodecRelation.isUnique is now marked as optional.
    • pgGetArgDetailsFromParameters().argDetails.postgresArgName is now optional
      (may return undefined in addition to null) and .required is now
      optional (returns boolean | undefined)
  • #2959
    8384026
    Thanks @benjie! - Add experimental schema
    minification support, useful for people exporting to Lambda or similar.

  • #2960
    57dfa70
    Thanks @benjie! - Use new Grafast
    markSyncAndSafe helper when defining sync and safe functions.

  • #2965
    d15e1c2
    Thanks @benjie! - Make EXPORTABLE's scope a
    readonly array for greater compatibility.

  • #2965
    c0b8af9
    Thanks @benjie! - Add new EXPORTABLE_CLONE_ARRAY
    helper for exporting arrays after construction

  • #2959
    c9fd9f3
    Thanks @benjie! - Use shared logic to decrease
    export size.

  • Updated dependencies
    [b793077,
    81ade71,
    57dfa70,
    d15e1c2]:

    • grafast@1.0.0-rc.8
    • tamedevil@0.1.0-rc.5

5.0.0-rc.4

Patch Changes

  • #2910
    9eb3829
    Thanks @benjie! - Use consistent type export
    syntax

  • a3722d6
    Thanks @benjie! - Refactor to enable TypeScript
    options rewriteRelativeImportExtensions and erasableSyntaxOnly (including
    using .ts extensions in source code)

  • #2916
    0f913ee
    Thanks @benjie! - Mark __origin as internal.

  • #2897
    7ca663e
    Thanks @benjie! - Fix various places where
    inflection.builtin() was not called, and thus changes to builtin inflection
    were not reflected. (Also adds test to prevent regression.)

  • Updated dependencies
    [9eb3829,
    a3722d6,
    5fc379e]:

    • graphile-config@1.0.0-rc.4
    • grafast@1.0.0-rc.5
    • tamedevil@0.1.0-rc.4

5.0.0-rc.3

Patch Changes

  • #2877
    1e45a3d
    Thanks @benjie! - Safety - use null prototype
    objects in more places.

  • #2873
    0772086
    Thanks @benjie! - Update TypeScript configuration
    to support Node 22 minimum

  • #2849
    a60ed2a
    Thanks @benjie! - "Transliterate" non-latin
    characters so that schemas can be constructed more easily when characters
    incompatible with GraphQL's Name are used.

    To disable, remove the new plugin:

     const preset = {
       extends: [AmberPreset /* ... */],
    +  disablePlugins: ['TransliterationPlugin'],
       /* ... */
     }
  • #2888
    1a56db2
    Thanks @benjaie! - Node v22+ is required for
    this module.

  • #2859
    65d9556
    Thanks @benjie! - Add tracing to inflectors

  • Updated dependencies
    [44555c7,
    1e45a3d,
    0772086,
    a565503,
    d9ccc82,
    1a56db2,
    eafa3f0,
    b27c562,
    f23f0cf]:

    • grafast@1.0.0-rc.4
    • graphile-config@1.0.0-rc.3
    • tamedevil@0.1.0-rc.3

5.0.0-rc.2

Patch Changes

5.0.0-rc.1

Patch Changes

  • #2777
    6a4e3b9
    Thanks @benjie! - Implement queue for
    watchGather/watchSchema/etc and integrate with grafserv's setPreset
    middleware. Promises returned by such now delay schema application, preventing
    growing concurrent work.

  • #2777
    c6cbe61
    Thanks @benjie! - Tighten our public API surface
    by:

    • renaming EventStreamHeandlerResult to the correctly spelt
      EventStreamHandlerResult (and keeping only a deprecated alias for the old
      name)
    • dropping the long-deprecated Grafast exports InterfaceOrUnionPlans (use
      InterfacePlan or UnionPlan as appropriate), deepEval (should be
      applyTransforms) and DeepEvalStep (should be ApplyTransformsStep)
    • removing the PgAdaptorOptions alias in favour of PgAdaptorSettings
    • deleting the PostGraphile preset aliases postgraphilePresetAmber should be
      PostGraphileAmberPreset) and PgRelayPreset (should be
      PostGraphileRelayPreset), and updating all first-party usage to the
      canonical names
  • 8a5a7c5
    Thanks @benjie! - Bump to release candidate

  • Updated dependencies
    [abb623d,
    7b86454,
    42a0785,
    d196d60,
    c6cbe61,
    d4ac603,
    8a5a7c5,
    ea0135f,
    b6821f5]:

    • grafast@1.0.0-rc.1
    • graphile-config@1.0.0-rc.1
    • tamedevil@0.1.0-rc.1

5.0.0-beta.39

Patch Changes

5.0.0-beta.38

Patch Changes

5.0.0-beta.37

Patch Changes

  • 9e21b2a
    Thanks @benjie! - Allow changing the Node ID
    codec from the default (base64JSON) to your own default via the
    preset.schema.defaultNodeIdCodec setting, or even override it on a per-table
    basis with the @nodeIdCodec smart tag. Thanks @jsmnbom!
  • Updated dependencies
    [2adfd6e,
    6113518]:
    • grafast@0.1.1-beta.25

5.0.0-beta.36

Patch Changes

  • #2600
    ad588ec
    Thanks @benjie! - Mark all
    peerDependencies=dependencies modules as optional peerDependencies to make
    pnpm marginally happier hopefully.
  • Updated dependencies
    [c54c6db,
    ad588ec]:
    • grafast@0.1.1-beta.24

5.0.0-beta.35

Patch Changes

5.0.0-beta.34

Patch Changes

5.0.0-beta.33

Patch Changes

5.0.0-beta.32

Patch Changes

5.0.0-beta.31

Patch Changes

  • Updated dependencies
    [83c546509]:
    • graphile-config@0.0.1-beta.14
    • grafast@0.1.1-beta.19

5.0.0-beta.30

Patch Changes

  • Updated dependencies
    [7580bc16a,
    b336a5829]:
    • graphile-config@0.0.1-beta.13
    • grafast@0.1.1-beta.18

5.0.0-beta.29

Patch Changes

  • #2251
    555d65cce
    Thanks @benjie! - We now enforce GraphQL name
    checks earlier and supply more information to better reveal where any invalid
    names are originating.

  • #2251
    efa25d97d
    Thanks @benjie! - 🚨 Inflection changes! V4
    preset should be (mostly) unaffected, but Amber preset will likely have
    changes between ID and ROW_ID in various places, plus missing underscores
    may reappear/etc. Be sure to diff your schema before/after this update (as you
    should with every update... and to be honest, with everything else that
    changes your schema).

    Normally camelCase/upperCamelCase/constantCase/etc are the final step
    before we name a field/type/enumValue/etc; however it turns out that some
    inflectors were using the camel-cased output as input to their own
    inflection - for example, when calculating the name of a relation it would
    take the column names camel-cased and then combine them into a string which
    was then camel-cased again. Even worse, when these values are then used in an
    enum, it would then be constant-cased, so you end up with string 👉
    camel-case 👉 concatenate 👉 camel-case 👉 concatenate 👉 constant-case. This
    lead to certain edge cases where fields with numbers or underscores may come
    out in unexpected ways.

    This release creates "raw" backing inflectors for a few things that remove the
    final step (camel-casing) so that later usage may choose to use the raw value
    rather than the camel-cased value. And due to this, we've also moved the id
    👉 rowId tweaks from the attribute() inflector into the _attributeName()
    inflector - which is where most of the changes have come from. We've undone
    this change in the V4 preset, so if you don't use the V5 preset but need to
    undo this change, please check out the V4 overrides of:

    Note: the V4 preset is fairly stable, but the Amber preset is being constantly
    iterated to improve the OOTB V5 experience - it will only be stable once
    V5.0.0 is released.

  • #2250
    86e228299
    Thanks @benjie! - Integrate preset.lib into build
    and gather context so plugins can use modules without needing to install
    dependencies (and thus avoiding the dual package hazard).

  • Updated dependencies
    [69ab227b5,
    d13b76f0f,
    b167bd849,
    6a13ecbd4]:

    • grafast@0.1.1-beta.17
    • graphile-config@0.0.1-beta.12

5.0.0-beta.28

Patch Changes

  • Updated dependencies
    [5626c7d36,
    76c7340b7]:
    • graphile-config@0.0.1-beta.11
    • grafast@0.1.1-beta.16

5.0.0-beta.27

Patch Changes

  • #2208
    632691409
    Thanks @benjie! - Behaviors can now be registered
    by more than one plugin. Apply behaviors to more entities. Don't log so much.

5.0.0-beta.26

Patch Changes

  • #2207
    0b1f7b577
    Thanks @benjie! - Fix overwhelming logs and
    errors being output by the new behavior system

5.0.0-beta.25

Patch Changes

  • #2156
    653929af0
    Thanks @benjie! - Improve error message when
    build.getTypeByName and related methods are called before the 'init' phase
    is complete.

  • #2198
    eb69c7361
    Thanks @benjie! - Fix incorrect context type used
    for GraphQLSchema_types hook, and add config to same context.

  • #2160
    54054b873
    Thanks @benjie! - Fix bug where creating the
    build object also initialized it; this is incorrect since if you just want the
    build object you don't necessarily want to register all of the GraphQL types
    (and potentially discover naming conflicts) at that moment. Introduced new
    schemaBuilder.initBuild(schemaBuilder.createBuild(input)) API to explicitly
    handle initing if you need an initialized build object.

  • #2160
    426e9320e
    Thanks @benjie! - Massive overhaul of the
    behavior system which now has a centralized registry of known behaviors and
    applies behaviors in a more careful and nuanced way, removing many hacks and
    workarounds, and ultimately meaning that defaultBehavior: "-*" should now
    operate correctly. Importantly, addBehaviorToTags() has been removed - you
    should use plugin.schema.entityBehaviors to indicate behaviors as shown in
    this PR - do not mod the tags directly unless they're explicitly meant to be
    overrides.

    Technically this is a significant breaking change (besides the removal of the
    addBehaviorToTags() helper) because the order in which behaviors are applied
    has changed, and so a different behavior might ultimately "win". This shows up
    in places where there is ambiguity, for example if you add @filterable to a
    function that you don't have execute permissions on, that function will now
    show up in the schema since user overrides (smart tags) "win" versus inferred
    behaviors such as introspected permissions; this wasn't the case before.
    Hopefully most users will not notice any difference, and for those who do, the
    graphile behavior debug CLI may be able to help you figure out what's going
    on.

    Be sure to print your schema before and after this update and look for
    changes; if there are changes then you likely need to fix the relevant
    behaviors/smart tags. (Hopefully there's no changes for you!)

    You'll also need to change any places where you're specifying behaviors that
    will be type checked; you can either cast your existing strings e.g.
    defaultBehavior: "+connection -list" as GraphileBuild.BehaviorString, or
    preferably you can specify your behaviors as an array, which should give you
    auto-complete on each entry; e.g. defaultBehavior: ["connection", "-list"].

  • #2199
    3b09b414f
    Thanks @benjie! - Database enum comments are now
    reflected in the schema.

  • #2155
    8b472cd51
    Thanks @benjie! - disablePlugins now supports
    TypeScript auto-completion of known plugin names. Other names are still
    accepted without error, so this is just a minor DX improvement rather than
    type safety.

  • #2198
    ba637b56d
    Thanks @benjie! - Ensure that interface subtypes
    are added to schema even if not referenced directly.

  • Updated dependencies
    [d5834def1,
    42b982463,
    884a4b429,
    38835313a,
    cc0941731,
    b0865d169,
    8b472cd51,
    9cd9bb522]:

    • grafast@0.1.1-beta.15
    • graphile-config@0.0.1-beta.10

5.0.0-beta.24

Patch Changes

5.0.0-beta.23

Patch Changes

  • Updated dependencies
    [807650035]:
    • grafast@0.1.1-beta.13

5.0.0-beta.22

Patch Changes

5.0.0-beta.21

Patch Changes

  • #2071
    582bd768f
    Thanks @benjie! - GrafastExecutionArgs now
    accepts resolvedPreset and requestContext directly; passing these through
    additional arguments is now deprecated and support will be removed in a future
    revision. This affects:

    • grafast()
    • execute()
    • subscribe()
    • hookArgs()

    graphile-config has gained a middleware system which is more powerful than
    it's AsyncHooks system. Old hooks can be emulated through the middleware
    system safely since middleware is a superset of hooks' capabilities.
    applyHooks has been renamed to orderedApply (because it applies to more
    than just hooks), calling applyHooks will still work but is deprecated.

    🚨 grafast no longer automatically reads your graphile.config.ts or
    similar; you must do that yourself and pass the resolvedPreset to grafast
    via the args. This is to aid in bundling of grafast since it should not need
    to read from filesystem or dynamically load modules.

    grafast no longer outputs performance warning when you set
    GRAPHILE_ENV=development.

    🚨 plugin.grafast.hooks.args is now plugin.grafast.middleware.prepareArgs,
    and the signature has changed - you must be sure to call the next() function
    and ctx/resolvedPreset can be extracted directly from args:

     const plugin = {
       grafast: {
    -    hooks: {
    +    middleware: {
    -      args({ args, ctx, resolvedPreset }) {
    +      prepareArgs(next, { args }) {
    +        const { requestContext: ctx, resolvedPreset } = args;
             // ...
    +        return next();
           }
         }
       }
     }

    Many more middleware have been added; use TypeScript's autocomplete to see
    what's available until we have proper documentation for them.

    plugin.grafserv.hooks.* are still supported but deprecated; instead use
    middleware plugin.grafserv.middleware.* (note that call signatures have
    changed slightly, similar to the diff above):

    • hooks.init -> middleware.setPreset
    • hooks.processGraphQLRequestBody -> middleware.processGraphQLRequestBody
    • hooks.ruruHTMLParts -> middleware.ruruHTMLParts

    A few TypeScript types related to Hooks have been renamed, but their old names
    are still available, just deprecated. They will be removed in a future update:

    • HookObject -> FunctionalityObject
    • PluginHook -> CallbackOrDescriptor
    • PluginHookObject -> CallbackDescriptor
    • PluginHookCallback -> UnwrapCallback
  • Updated dependencies
    [582bd768f]:

    • graphile-config@0.0.1-beta.9
    • grafast@0.1.1-beta.11

5.0.0-beta.20

Patch Changes

5.0.0-beta.19

Patch Changes

  • Updated dependencies
    [437570f97]:
    • grafast@0.1.1-beta.9

5.0.0-beta.18

Patch Changes

5.0.0-beta.17

Patch Changes

5.0.0-beta.16

Patch Changes

  • #1955
    6c6be29f1
    Thanks @benjie! - Steps are now prevented from
    calling other steps' lifecycle methods. GRAPHILE_ENV is actively encouraged,
    and falls back to NODE_ENV.

  • #1949
    179d25b09
    Thanks @benjie! - Add support for registering
    PgCodecs via plugins, add support for ltree type, improve error messages, no
    longer need to set a gather namespace to use cache/state.

  • #1958
    8315e8d01
    Thanks @benjie! - EXPORTABLE now accepts a third
    argument, nameHint, which is used to hint what variable name to use for the
    given value. Used this in graphile-export along with some fixes and
    optimizations to improve the exports further.

  • #1946
    9d53dde72
    Thanks @benjie! - Exporting a schema now performs
    ESLint 'no-use-before-define' check to catch even more invalid export
    conditions. Fix registerNodeIdCodec calls caught by this.

  • Updated dependencies
    [9f85c614d,
    6c6be29f1,
    8315e8d01]:

    • grafast@0.1.1-beta.6

5.0.0-beta.15

Patch Changes

  • #1933
    3a2ea80ee
    Thanks @mattiarossi! -
    eslint-plugin-graphile-export now spots instances of inputPlan,
    applyPlan and assertStep so they can be checked - thanks @mattiarossi!

  • #1924
    ef44c29b2
    Thanks @benjie! - 🚨 TypeScript is now configured
    to hide interfaces marked as @internal. This may result in a few errors
    where you're accessing things you oughtn't be, but also may hide some
    interfaces that should be exposed - please file an issue if an API you were
    dependent on has been removed from the TypeScript typings. If that API happens
    to be step.dependencies; you should first read this:
    https://benjie.dev/graphql/ancestors

  • #1935
    8ea67f891
    Thanks @benjie! - Fix lots of things related to
    exporting a schema with graphile-export.

  • #1935
    e20e66ed7
    Thanks @benjie! - Make even more of the schema
    exportable, including handling scalars with no parseLiteral definition.

  • Updated dependencies
    [63dd7ea99,
    d801c9778,
    ef44c29b2,
    5de3e86eb]:

    • grafast@0.1.1-beta.5
    • graphile-config@0.0.1-beta.7

5.0.0-beta.14

Patch Changes

5.0.0-beta.13

Patch Changes

  • Updated dependencies
    [0df5511ac]:
    • graphile-config@0.0.1-beta.6
    • grafast@0.1.1-beta.3

5.0.0-beta.12

Patch Changes

5.0.0-beta.11

Patch Changes

  • Updated dependencies
    [49fcb0d58,
    7aef73319]:
    • grafast@0.1.1-beta.1
    • graphile-config@0.0.1-beta.4

5.0.0-beta.10

Patch Changes

5.0.0-beta.9

Patch Changes

5.0.0-beta.8

Patch Changes

  • Updated dependencies
    [3700e204f]:
    • grafast@0.0.1-beta.7

5.0.0-beta.7

Patch Changes

5.0.0-beta.6

Patch Changes

  • #488
    73f1b5218
    Thanks @benjie! - specForHandler now only
    requires handler - no need to pass codec.

  • Updated dependencies
    [53186213a]:

    • grafast@0.0.1-beta.5

5.0.0-beta.5

Patch Changes

  • Updated dependencies
    [f9cc88dc4]:
    • grafast@0.0.1-beta.4

5.0.0-beta.4

Patch Changes

  • #454
    196e5c1aa
    Thanks @benjie! -
    @interface mode=single/relational now get Node interface if the table has
    a PK.

    🚨 @interface mode=union no longer gets Node interface unless you also add
    @behavior node.

5.0.0-beta.3

Patch Changes

5.0.0-beta.2

Patch Changes

  • Updated dependencies
    [23bd3c291]:
    • grafast@0.0.1-beta.2

5.0.0-beta.1

Patch Changes

  • cbd987385
    Thanks @benjie! - Bump all packages to beta

  • Updated dependencies
    [cbd987385]:

    • grafast@0.0.1-beta.1
    • graphile-config@0.0.1-beta.1

5.0.0-alpha.18

Patch Changes

  • Updated dependencies
    [dfefdad3c]:
    • grafast@0.0.1-alpha.16

5.0.0-alpha.17

Patch Changes

  • #433
    5491e10b0
    Thanks @benjie! - Improve error messages from
    custom string scalars when they cannot be parsed as a string.

  • #438
    a22830b2f
    Thanks @benjie! - Plugin name now automatically
    used in provides for every hook, allowing ordering hooks before/after their
    equivalents in other plugins.

  • Updated dependencies
    [ea003ca3a,
    57d88b5fa,
    a22830b2f,
    9f87a26b1]:

    • grafast@0.0.1-alpha.15
    • graphile-config@0.0.1-alpha.7

5.0.0-alpha.16

Patch Changes

5.0.0-alpha.15

Patch Changes

  • Updated dependencies
    [d99d666fb]:
    • grafast@0.0.1-alpha.14

5.0.0-alpha.14

Patch Changes

  • #417
    e7dd2e039
    Thanks @benjie! - codec is now baked into
    NodeId handlers (rather than using codecName and looking that up in
    codecs). All related APIs have thus simplified, e.g. the step
    node(codecs, handler, $id) is now node(handler, $id), etc. TypeScript
    should point out any issues you have hopefully.

  • #418
    9ab2adba2
    Thanks @benjie! - Overhaul peerDependencies and
    dependencies to try and eliminate duplicate modules error.

  • #410
    4eda0cd57
    Thanks @benjie! - Use a single behavior check per
    location.

    In the past two weeks I added a few behavior strings like
    array:attribute:filterBy (a scoped form of attribute:filterBy to only be
    used by attributes that were arrays); however I've realised that this will
    require plugin authors to implement all the same logic to figure out what type
    an attribute is in order to then see if it has the relevant behavior. This
    goes against the design of the behavior system, and makes plugin authors'
    lives harder. So I've reverted this, and instead used the entityBehaviors
    system to add or remove the base attribute:filterBy (etc) behavior depending
    on what the type of the attribute is.

  • Updated dependencies
    [620f9e07e,
    1882e0185,
    881672305,
    e5012f9a1,
    9ab2adba2,
    47f6f018b,
    ff4395bfc,
    502b23340]:

    • grafast@0.0.1-alpha.13

5.0.0-alpha.13

Patch Changes

  • #407
    9281a2d88
    Thanks @benjie! - Exported version no longer
    uses require('../package.json') hack, instead the version number is written
    to a source file at versioning time. Packages now export version.

  • #406
    9f5a784c6
    Thanks @benjie! - Introduce TypeScript CIF
    gatherConfig() to help typing the gather phase for plugins.

  • #408
    2849cc3fb
    Thanks @benjie! - Better handle the situation
    where a node fetcher could not be found.

  • #408
    8ca9425ed
    Thanks @benjie! - Detect when your preset doesn't
    have any plugins, or omits the QueryPlugin, and raise an error or warning
    indicating to the user that there's likely an issue here.

  • #408
    dda361d11
    Thanks @benjie! - Improve error messages for
    getInputTypeByName and getOutputTypeByName.

  • Updated dependencies
    [9281a2d88,
    675b7abb9,
    c5050dd28,
    0d1782869]:

    • grafast@0.0.1-alpha.12
    • graphile-config@0.0.1-alpha.6

5.0.0-alpha.12

Patch Changes

  • #402
    644938276
    Thanks @benjie! - Use file:// URLs in import()
    to fix compatibility with Windows (e.g. when loading graphile.config.mjs)

  • #402
    47365f0df
    Thanks @benjie! - Add helper for more easily
    handling NodeIDs for known typeName.

  • Updated dependencies
    [644938276]:

    • graphile-config@0.0.1-alpha.5
    • grafast@0.0.1-alpha.11

5.0.0-alpha.11

Patch Changes

5.0.0-alpha.10

Patch Changes

  • #349
    a94f11091
    Thanks @benjie! - Overhaul behavior system

    Previously the behavior system worked during the schema building process,
    inside the various schema hooks. So looking at the behavior of a relation
    might have looked like:

    GraphQLObjectType_fields_field(field, build, context) {
      const relation = context.scope.pgRelationOrWhatever;
    
      // Establish a default behavior, e.g. you might give it different default behavior
      // depending on if the remote table is in the same schema or not
      const defaultBehavior = someCondition(relation) ? "behavior_if_true" : "behavior_if_false";
    
      // Now establish the user-specified behavior for the entity, inheriting from all the
      // relevant places.
      const behavior = getBehavior([
        relation.remoteResource.codec.extensions,
        relation.remoteResource.extensions,
        relation.extensions
      ]);
    
      // Finally check this behavior string against `behavior_to_test`, being sure to apply
      // the "schema-time smart defaulting" that we established in `defaultBehavior` above.
      if (build.behavior.matches(behavior, "behavior_to_test", defaultBehavior)) {
        doTheThing();
      }

    This meant that each plugin might treat the behavior of the entity different -
    for example postgraphile-plugin-connection-filter might have a different
    someCondition() under which the "filter" behavior would apply by default,
    whereas the built in condition plugin might have a different one.

    Moreover, each place needs to know to call getBehavior with the same list of
    extension sources in the same order, otherwise subtle (or not so subtle)
    differences in the schema would occur.

    And finally, because each entity doesn't have an established behavior, you
    can't ask "what's the final behavior for this entity" because it's dynamic,
    depending on which plugin is viewing it.

    This update fixes all of this; now each entity has a single behavior that's
    established once. Each plugin can register entityBehaviors for the various
    behavior entity types (or global behaviors which apply to all entity types if
    that makes more sense). So the hook code equivalent to the above would now be
    more like:

    GraphQLObjectType_fields_field(field, build, context) {
      const relation = context.scope.pgRelationOrWhatever;
      // Do the thing if the relation has the given behavior. Simples.
      if (build.behavior.pgCodecRelationMatches(relation, "behavior_to_test")) {
        doTheThing();
      }

    This code is much more to the point, much easier for plugin authors to
    implement, and also a lot easier to debug since everything has a single
    established behavior now (except refs, which aren't really an entity in
    their own right, but a combination of entities...).

    These changes haven't changed any of the schemas in the test suite, but they
    may impact you. This could be a breaking change - so be sure to do a schema
    diff before/after this.

  • #361
    dad4d4aae
    Thanks @benjie! - Instead of passing
    resolvedPreset to behaviors, pass Build.

  • Updated dependencies
    [56237691b,
    ed1982f31,
    1fe47a2b0,
    198ac74d5,
    6878c589c,
    2ac706f18]:

    • grafast@0.0.1-alpha.9
    • graphile-config@0.0.1-alpha.4

5.0.0-alpha.9

Patch Changes

  • Updated dependencies
    [dd3ef599c]:
    • grafast@0.0.1-alpha.8

5.0.0-alpha.8

Patch Changes

5.0.0-alpha.7

Patch Changes

  • Updated dependencies
    [f75926f4b]:
    • grafast@0.0.1-alpha.6

5.0.0-alpha.6

Patch Changes

5.0.0-alpha.5

Patch Changes

  • Updated dependencies
    [45dcf3a8f]:
    • grafast@0.0.1-alpha.4

5.0.0-alpha.4

Patch Changes

  • #332
    faa1c9eaa
    Thanks @benjie! - Adjust dependencies and
    peerDependencies and peerDependenciesMeta.

5.0.0-alpha.3

Patch Changes

5.0.0-alpha.2

Patch Changes

  • Updated dependencies
    [3df3f1726]:
    • grafast@0.0.1-alpha.2

5.0.0-alpha.1

Patch Changes

5.0.0-1.3

Patch Changes

  • Updated dependencies
    [8d270ead3,
    b4eaf89f4]:
    • grafast@0.0.1-1.3
    • graphile-config@0.0.1-1.2

5.0.0-1.2

Patch Changes

  • Updated dependencies
    [7dcb0e008]:
    • grafast@0.0.1-1.2

5.0.0-1.1

Patch Changes

  • #287
    c5d89d705
    Thanks @benjie! - Fix the type definition of
    GatherHooks to allow plugins to indicate individual gather hook ordering.

  • #260
    d5312e6b9
    Thanks @benjie! - TypeScript v5 is now required

  • #265
    22ec50e36
    Thanks @benjie! - 'extensions.graphile' is now
    'extensions.grafast'

  • #271
    261eb520b
    Thanks @benjie! - 🚨 RENAME ALL THE THINGS

    The term 'source' was overloaded, and 'configs' was too vague, and
    'databaseName' was misleading, and 'source' behaviours actually applied to
    resources, and more. So, we've renamed lots of things as part of the API
    stabilization work. You're probably only affected by the first 2 bullet
    points.

    • pgConfigs -> pgServices (also applies to related pgConfig terms such
      as makePgConfig -> makePgService, MakePgConfigOptions ->
      MakePgServiceOptions, etc) - see your graphile.config.ts or equivalent
      file
    • All *:source:* behaviors are now *:resource:* behaviors (use regexp
      /:source\b|\bsource:[a-z$]/ to find the places that need updating)
    • PgDatabaseConfiguration -> PgServiceConfiguration
    • databaseName -> serviceName (because it's not the name of the database,
      it's the name of the pgServices (which was pgConfigs) entry)
    • PgResourceConfig::source -> PgResourceConfig.from ('source' is
      overloaded, so use a more direct term)
    • PgResource::source -> PgResource.from
    • PgSelectPlanJoin::source -> PgSelectPlanJoin.from
    • helpers.pgIntrospection.getDatabase ->
      helpers.pgIntrospection.getService
    • helpers.pgIntrospection.getExecutorForDatabase ->
      helpers.pgIntrospection.getExecutorForService
  • Updated dependencies
    [ae304b33c,
    d5312e6b9,
    22ec50e36,
    0f4709356,
    395b4a2dd]:

    • grafast@0.0.1-1.1
    • graphile-config@0.0.1-1.1
    • graphile-export@0.0.2-1.1

5.0.0-0.29

Patch Changes

5.0.0-0.28

Patch Changes

  • #233
    a50bc5be4
    Thanks @benjie! - Introduce new
    GraphQLObjectType_fields_field_args_arg and
    GraphQLInterfaceType_fields_field_args_arg hooks to resolve some plugin
    ordering issues.

  • #233
    6fb7ef449
    Thanks @benjie! - Also trim the empty
    descriptions from interface fields/args in addition to all the existing places
    empty descriptions are trimmed.

  • #233
    11e7c12c5
    Thanks @benjie! - Solve mutation issue in plugin
    ordering code which lead to heisenbugs.

  • Updated dependencies
    [11e7c12c5]:

    • graphile-config@0.0.1-0.6
    • grafast@0.0.1-0.22

5.0.0-0.27

Patch Changes

5.0.0-0.26

Patch Changes

  • Updated dependencies [aac8732f9]:
    • grafast@0.0.1-0.20

5.0.0-0.25

Patch Changes

  • Updated dependencies
    [397e8bb40]:
    • grafast@0.0.1-0.19

5.0.0-0.24

Patch Changes

  • #220
    2abc58cf6
    Thanks @benjie! - Convert a few more more options
    from V4 to V5.

    Explicitly remove query batching functionality, instead use HTTP2+ or
    websockets or similar.

    Add schema exporting.

  • #223
    df8c06657
    Thanks @benjie! - graphile-utils now includes
    the makeAddPgTableConditionPlugin and makeAddPgTableOrderByPlugin
    generators, freshly ported from V4. The signatures of these functions has
    changed slightly, but the functionality is broadly the same.

  • Updated dependencies
    [4c2b7d1ca,
    c8a56cdc8]:

    • grafast@0.0.1-0.18

5.0.0-0.23

Patch Changes

  • #219
    b58f5dfac
    Thanks @benjie! - Rename
    GraphileBuild.GraphileBuildGatherOptions to GraphileBuild.GatherOptions.
    Rename GraphileBuild.GraphileBuildInflectionOptions to
    GraphileBuild.InflectionOptions.

5.0.0-0.22

Patch Changes

  • f48860d4f - Allow adding resolver-only fields to planned types.

  • Updated dependencies [f48860d4f]:

    • grafast@0.0.1-0.17

5.0.0-0.21

Patch Changes

  • Updated dependencies
    [df89aba52]:
    • grafast@0.0.1-0.16

5.0.0-0.20

Patch Changes

  • #210
    2fb5001b4
    Thanks @benjie! - retryOnInitFail implemented,
    and bug in introspection cache on error resolved.

  • #210
    b523118fe
    Thanks @benjie! - Replace BaseGraphQLContext with
    Grafast.Context throughout.

  • Updated dependencies
    [b523118fe]:

    • grafast@0.0.1-0.15

5.0.0-0.19

Patch Changes

5.0.0-0.18

Patch Changes

5.0.0-0.17

Patch Changes

  • Updated dependencies [e5b664b6f]:
    • grafast@0.0.1-0.13

5.0.0-0.16

Patch Changes

  • #198
    a1158d83e
    Thanks @benjie! - Gather phase initialState may
    now be asynchronous. If initialCache returns a promise, a helpful error
    message with advice is now raised.
  • Updated dependencies
    [4f5d5bec7,
    25f5a6cbf]:
    • grafast@0.0.1-0.12

5.0.0-0.15

Patch Changes

  • 0ab95d0b1 - Update sponsors.

  • #190
    652cf1073
    Thanks @benjie! - 🚨 Breaking changes around
    types and postgres configuration:

    • GraphileBuild.GraphileResolverContext renamed to Grafast.Context
    • GraphileConfig.GraphQLRequestContext renamed to Grafast.RequestContext
    • Grafast.PgDatabaseAdaptorOptions renaed to
      GraphileConfig.PgDatabaseAdaptorOptions
    • @dataplan/pg/adaptors/node-postgres is now @dataplan/pg/adaptors/pg due
      to the bizarre naming of PostgreSQL clients on npm - we've decided to use
      the module name as the unique identifier
    • makePgConfigs:
      • is now makePgConfig (singular) - so you'll need to wrap it in an array
        where you use it
      • no longer exported by @dataplan/pg (because it depended on pg) -
        instead each adaptor exposes this helper - so import from
        @dataplan/pg/adaptors/node-postgres
      • accepts an object parameter containing
        {connectionString, schemas, superuserConnectionString}, rather than
        multiple string parameters
    • makeNodePostgresWithPgClient -> makePgAdaptorWithPgClient
    • postgraphile CLI will now try and respect the adaptor stated in your
      preset when overriding connection arguments
    • Removed Grafast.RequestContext.httpRequest and instead use
      Grafast.RequestContext.node.req/res; all server adaptors should implement
      this if appropriate
  • Updated dependencies [0ab95d0b1,
    4783bdd7c,
    652cf1073]:

    • grafast@0.0.1-0.11
    • graphile-config@0.0.1-0.5

5.0.0-0.14

Patch Changes

  • 72bf5f535 - Overhaul the behavior system (see
    https://postgraphile.org/postgraphile/next/behavior).
    • Adds schema.defaultBehavior configuration option to save having to write a
      plugin for such a simple task
    • Changes a bunch of behavior strings:
      • (query|singularRelation|manyRelation|queryField|typeField):(list|connection|single)
        -> $1:source:$2 (e.g. query:list -> query:source:list)
    • Checks for more specific behaviors, e.g. source:update or
      constraint:source:update or attribute:update rather than just update
    • Updates every change to getBehavior so that it follows the relevant chain
      (e.g. codec -> source -> relation for relations, similar for other types)
    • More helpful error message when -insert prevents functions with input
      arguments working
    • Throw an error if you try and use "create" scope (because we use
      insert/update/delete not create/update/delete)

5.0.0-0.13

Patch Changes

  • Updated dependencies
    [842f6ccbb]:
    • graphile-config@0.0.1-0.4
    • grafast@0.0.1-0.10

5.0.0-0.12

Patch Changes

5.0.0-0.11

Patch Changes

  • #176
    11d6be65e
    Thanks @benjie! - Fix issue with plugin
    versioning. Add more TSDoc comments. New getTerminalWidth() helper.
  • Updated dependencies
    [19e2961de,
    11d6be65e]:
    • graphile-config@0.0.1-0.3
    • grafast@0.0.1-0.9

5.0.0-0.10

Patch Changes

  • Updated dependencies
    [208166269]:
    • grafast@0.0.1-0.8

5.0.0-0.9

Patch Changes

  • 6ebe3a13e
    Thanks @benjie! - Enable omitting update/delete
    mutations using behaviors on unique constraints.

5.0.0-0.8

Patch Changes

  • 677c8f5fc - Create new getTags() introspection helper and use
    it. Rename GraphileBuild.GraphileBuildSchemaOptions to
    GraphileBuild.SchemaOptions. Fix a couple minor inflection bugs. Add some
    missing descriptions. Fix the initial inflection types to not leak
    implementation details. Fix inflectors to use ResolvedPreset rather than
    Preset.
  • Updated dependencies []:
    • grafast@0.0.1-0.7

5.0.0-0.7

Patch Changes

  • 9b296ba54 - More secure, more compatible, and lots of fixes
    across the monorepo

  • Updated dependencies [9b296ba54]:

    • grafast@0.0.1-0.6
    • graphile-config@0.0.1-0.2

5.0.0-0.6

Patch Changes

  • Updated dependencies [cd37fd02a]:
    • grafast@0.0.1-0.5

5.0.0-0.5

Patch Changes

  • 768f32681 - Fix peerDependencies ranges

  • Updated dependencies [768f32681]:

    • grafast@0.0.1-0.4
    • graphile-export@0.0.2-0.4

5.0.0-0.4

Patch Changes

  • d11c1911c - Fix dependencies

  • Updated dependencies [d11c1911c]:

    • grafast@0.0.1-0.3
    • graphile-config@0.0.1-0.1
    • graphile-export@0.0.2-0.3

5.0.0-0.3

Patch Changes

  • Updated dependencies [25037fc15]:
    • grafast@0.0.1-0.2
    • graphile-export@0.0.2-0.2

5.0.0-0.2

Patch Changes

  • Updated dependencies [55f15cf35]:
    • grafast@0.0.1-0.1
    • graphile-export@0.0.2-0.1

5.0.0-0.1

Patch Changes

  • #125
    91f2256b3
    Thanks @benjie! - Initial changesets release

  • Updated dependencies
    [91f2256b3]:

    • @graphile/lru@5.0.0-0.1
    • grafast@0.0.1-0.0
    • graphile-config@0.0.1-0.0
    • graphile-export@0.0.2-0.0

Don't miss a new crystal release

NewReleases is sending notifications on new releases.