-
#2071
582bd768f
Thanks @benjie! -GrafastExecutionArgs
now acceptsresolvedPreset
andrequestContext
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 toorderedApply
(because it applies to more than just hooks), callingapplyHooks
will still work but is deprecated.🚨
grafast
no longer automatically reads yourgraphile.config.ts
or similar; you must do that yourself and pass theresolvedPreset
to grafast via theargs
. 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 setGRAPHILE_ENV=development
.🚨
plugin.grafast.hooks.args
is nowplugin.grafast.middleware.prepareArgs
, and the signature has changed - you must be sure to call thenext()
function and ctx/resolvedPreset can be extracted directly fromargs
: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 middlewareplugin.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
- #2048
db8ceed0f
Thanks @benjie! - Help detect more invalid presets and plugins (bad imports) by forbidding keys starting with a capital or the keydefault
.
- #1930
5de3e86eb
Thanks @benjie! - Prevent using appendPlugins/prependPlugins/skipPlugins in presets.
- #1892
0df5511ac
Thanks @benjie! - Fix plugin ordering bug that ignored before/after when there was no provider; this now means PgSmartTagsPlugin is correctly loaded before PgFakeConstraintPlugin, fixing thepostgraphile.tags.json5
file.
- #1877
8a0cdb95f
Thanks @benjie! - Move 'declare global' out of 'interfaces.ts' and into 'index.ts' or equivalent. Should make TypeScript more aware of these types.
- #438
a22830b2f
Thanks @benjie! - Plugin name now automatically used inprovides
for every hook, allowing ordering hooks before/after their equivalents in other plugins.
-
#408
675b7abb9
Thanks @benjie! -inspect()
fallback function updated -
#408
c5050dd28
Thanks @benjie! - Warn if plugins could not be disabled (due to not being specified). -
#408
0d1782869
Thanks @benjie! - Only eat ENOENT errors when checking for file existance, other errors should still throw.
- #402
644938276
Thanks @benjie! - Usefile://
URLs in import() to fix compatibility with Windows (e.g. when loadinggraphile.config.mjs
)
- #344
adc7ae5e0
Thanks @benjie! - Detect presets that look like plugins and vice versa and throw error.
759ad403d
Thanks @benjie! - Alpha release - see https://postgraphile.org/news/2023-04-26-version-5-alpha
- #297
b4eaf89f4
Thanks @benjie! - AsyncHooks can now execute synchronously if all registered hooks are synchronous. May impact ordering of fields/types in GraphQL schema.
- #233
11e7c12c5
Thanks @benjie! - Solve mutation issue in plugin ordering code which lead to heisenbugs.
0ab95d0b1
- Update sponsors.
- #184
842f6ccbb
Thanks @benjie! - Handle array-to-object issue in graphile-config when multiple presets set an array key.
-
#176
19e2961de
Thanks @benjie! - Better graphile.config.* compatibility with ESM-emulation, so 'export default preset;' should work in TypeScript even if outputting to CommonJS. -
#176
11d6be65e
Thanks @benjie! - Fix issue with plugin versioning. Add more TSDoc comments. New getTerminalWidth() helper.
9b296ba54
- More secure, more compatible, and lots of fixes across the monorepo
d11c1911c
- Fix dependencies