-
#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
-
Updated dependencies [
582bd768f
]:
- #2064
437570f97
Thanks @benjie! - Fix a bug relating to Global Object Identifiers (specifically in update mutations, but probably elsewhere too) related to early exit. - Updated dependencies
[
437570f97
]:
-
#2015
5eca6d65a
Thanks @benjie! - UseinhibitOnNull
when decoding a spec ID to prevent it being consumed if invalid (e.g. don't allow using a 'Post' node ID to fetch a 'Person' record). -
#1994
ab08cbf9c
Thanks @benjie! - Introduceinterface SQLable {[$toSQL](): SQL}
topg-sql2
and use it to simplify SQL fragments in various places. -
#1978
a287a57c2
Thanks @benjie! - Breaking:connection()
step now accepts configuration object in place of 2nd argument onwards:-return connection($list, nodePlan, cursorPlan); +return connection($list, { nodePlan, cursorPlan });
Feature:
edgeDataPlan
can be specified as part of this configuration object, allowing you to associate edge data with your connection edges:return connection($list, { edgeDataPlan($item) { return object({ item: $item, otherThing: $otherThing }); }, }); // ... const plans = { FooEdge: { otherThing($edge) { return $edge.data().get("otherThing"); }, }, };
Feature:
ConnectionStep
andEdgeStep
gainget()
methods, so*Connection.edges
,*Connection.nodes
,*Connection.pageInfo
,*Edge.node
and*Edge.cursor
no longer need plans to be defined. -
#2006
7ad35fe4d
Thanks @benjie! - When replacing inflectors viaplugin.inflection.replace.<inflector_name>
the first argument is the previous inflector (or null). Previously this was typed including thethis: Inflection
argument which meant to appease TypeScript you needed to doprevious.call(this, arg1, arg2)
, but this was never necessary in JS. This is now fixed, and you can now issueprevious(arg1, arg2)
from TypeScript without error. -
#2050
272608c13
Thanks @benjie! - Add missing EXPORTABLE (and remove excessive EXPORTABLE) to fix schema exports. -
#1995
e0d69e518
Thanks @benjie! - Refactoring of unary logic. -
#2048
db8ceed0f
Thanks @benjie! - Help detect more invalid presets and plugins (bad imports) by forbidding keys starting with a capital or the keydefault
. -
#2046
966203504
Thanks @benjie! - Envelop peer dependency upgraded to V5 -
#1973
a0e82b9c5
Thanks @benjie! - Add 'unary steps' concept to codebase and refactor to using new executeV2 execution method which leverages them. Backwards compatibility maintained, but users should move to executeV2. -
#1989
c48d3da7f
Thanks @benjie! - Make it so that more pgSelect queries optimize themselves into parent queries via new step.canAddDependency helper. -
#2006
bee0a0a68
Thanks @benjie! - Adopt improved inflection typings. -
#2019
51a94417f
Thanks @benjie! - Now possible to filter by relay node identifiers without weird results if you pass an incompatible node id (e.g. a 'Post' ID where a 'User' ID was expected) - significantly improves the Relay preset. -
#1988
81d17460c
Thanks @benjie! - Fix issue with record types when attributes need to be cast; this previously caused errors with computed columns when passed particular arguments. -
Updated dependencies [
357d475f5
,30bcd6c12
,3551725e7
,80836471e
,b788dd868
,5eca6d65a
,a5c20fefb
,1ce08980e
,ab08cbf9c
,dff4f2535
,a287a57c2
,45e10950b
,2fe56f9a6
,fed603d71
,ed6e0d278
,86168b740
,7ad35fe4d
,e82e4911e
,94a05064e
,272608c13
,42ece5aa6
,e0d69e518
,e22cb4dfa
,db8ceed0f
,a5a0816bd
,6699388ec
,966203504
,c1645b249
,ed8bbaa3c
,a0e82b9c5
,14e2412ee
,c48d3da7f
,57ab0e1e7
,8442242e4
,bee0a0a68
,51a94417f
,64ce7b765
,cba842357
,2fa77d0f2
,81d17460c
]:
-
#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. -
#1944
6c80c44b7
Thanks @benjie! - Fix accidental double-encoding of values on their way to postgres. -
#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 ingraphile-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. FixregisterNodeIdCodec
calls caught by this. -
Updated dependencies [
9f85c614d
,6c6be29f1
,6c80c44b7
,179d25b09
,8315e8d01
,9d53dde72
]:
-
#1927
00d32d887
Thanks @benjie! - Excludes table constraints on tables from extensions if configured to not include extensions. -
#1927
c62eee10b
Thanks @benjie! - Add pg_am to pg-introspection to enable determining index access method -
#1934
9ac0ddc01
Thanks @benjie! - Automatically detect when agraphile-export
export is invalid, and throw an error indicating which method needs to haveEXPORTABLE
added around it. -
#1931
941e28003
Thanks @benjie! - Add support for deprecated arguments to Ruru. -
#1935
8ea67f891
Thanks @benjie! - Fix lots of things related to exporting a schema withgraphile-export
. -
#1931
068be2f51
Thanks @benjie! - Fix issue typing into Ruru explorer plugin - characters no longer overwritten. -
#1929
7587ca9e0
Thanks @benjie! - PgLazyJWTPreset: return 401 error when validation of JWT fails. -
#1935
e20e66ed7
Thanks @benjie! - Make even more of the schema exportable, including handling scalars with no parseLiteral definition. -
#1931
ec3112c7b
Thanks @benjie! - Add support for deprecating arguments to makeExtendSchemaPlugin -
Updated dependencies [
49fd8afed
,63dd7ea99
,d801c9778
,c21252541
,3a2ea80ee
,ef44c29b2
,8ea67f891
,5de3e86eb
,e20e66ed7
,ec3112c7b
]:
-
#1895
555a2be03
Thanks @enisdenjo! - Fix issue with aggregates for polymorphic connections. -
#1917
886833e2e
Thanks @benjie! - AddpolymorphicBranch
step to core to help users deal with simple polymorphic use cases. -
#1904
5b2db0c75
Thanks @benjie! - Add pgRefDetails to scope for some ref-generated fields, to enable plugins to hook them. -
#1920
635af159f
Thanks @benjie! - Add ability to set (and infer) scopes to makeExtendSchemaPlugin -
#1905
184773382
Thanks @benjie! - Enable specifying the polymorphic subtype a function returns via@returnType MyType
smart tag. -
#1901
f97d7976a
Thanks @benjie! - Loosens step assertion from Query type so it can be served fromconstant(true)
. -
Updated dependencies [
555a2be03
,1b6c2f636
,de7add402
,a2176ea32
,886833e2e
,5b2db0c75
,635af159f
,184773382
,f97d7976a
]:
-
#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. -
#1894
7851d89ab
Thanks @benjie! - Fix logic around RBAC permissions for tables and sequences. -
Updated dependencies [
0df5511ac
]:
-
#1884
bce0636d4
Thanks @benjie! - Fixes multiple pgServices codec name conflicts by prepending the service name if it's not 'main'. -
#1867
004889258
Thanks @benjie! - Fix bug in CLI parser where omitting--watch
would forcewatch: false
even if config setswatch: true
. -
#1817
f305c3278
Thanks @benjie! - Add support for limiting polymorphic plans (only some of them, specificallypgUnionAll()
right now) to limit the types of their results; exposed via an experimental 'only' argument on fields, for exampleallApplications(only: [GcpApplication, AwsApplication])
would limit the type of applications returned to only be the two specified. -
#1885
9e1df08b7
Thanks @benjie! - FixorderBy:null
regression -
#1878
e04238c0a
Thanks @benjie! - Add emulation for--simple-subscriptions
to V4 preset. -
#1884
c66c3527c
Thanks @benjie! - List codecs can now have names. -
Updated dependencies [
3fdc2bce4
,aeef362b5
,8a76db07f
,bce0636d4
,f305c3278
,3b558e0c1
,2ae8d33aa
,9e1df08b7
,8a0cdb95f
,dbd91fdd8
,995e25035
,f1d5ad18e
,c66c3527c
,f66cc40b3
,f18635a5c
,1c9f1c0ed
,9fb5cc06e
]:
- #1834
2e7fc6449
Thanks @benjie! - Fix issue with watch mode where schema omits database resources in some situations. - Updated dependencies
[
9696a1b08
,49fcb0d58
,2e7fc6449
,7aef73319
]:
-
#1799
3dd5d86d6
Thanks @jvandermey! - Can now pass onEdit callbacks through the Ruru config via the plugin system; e.g. to update the URL search params with the current editor state. -
#1801
2d447a6b4
Thanks @benjie! - Fix bug where the owner of a database object wasn't seen as having any privileges. -
Updated dependencies [
2d447a6b4
]:
-
#1796
ebb0b817e
Thanks @benjie! - Can now set initial query and variables in Ruru via the plugin system; e.g. to set query/variables based on query string. -
#1797
26e0bc726
Thanks @benjie! - Fix that smart tags were not copied onto enum codecs.
- Updated dependencies
[
2805edc68
]:
-
#1779
4a4d26d87
Thanks @benjie! - Fix a polymorphic planning issue. -
#1778
b2bce88da
Thanks @benjie! - Enable source maps in modules where it was disabled. -
#1780
861a8a306
Thanks @benjie! - Fix an issue with side effect plans and polymorphism -
#1770
9a84bc6dd
Thanks @benjie! - Fix issues around enum tables: indicate when an enum table codec replaces a regular attribute codec, expose helpers for working with enum tables, and don't exclude enum table references when using the Relay preset. -
#1774
7d55d2c34
Thanks @benjie! - Addpreset.gather.pgIdentifiers
setting (values: 'qualified' or 'unqualified'); if set to 'unqualified' then we will not add the schema name to table or function identifiers - it's up to you to ensure they're present in thesearch_path
(which you can set viapgSettings
on a per-request basis). -
Updated dependencies [
eeccfd675
,4a4d26d87
,b2bce88da
,861a8a306
,9a84bc6dd
,b728d7fb9
,264158f03
,2d31f058b
,7d55d2c34
]:
-
#514
c9848f693
Thanks @benjie! - Update package.json repository information -
Updated dependencies [
c9848f693
,ede1092fe
,566983fbd
,409bf6071
]:
- Updated dependencies []:
- Updated dependencies
[
3700e204f
]:
-
#496
ac092e021
Thanks @benjie! - PostGraphile no longer exportsGraphileBuild
norGraphileConfig
- these are global namespaces. -
#496
c9bfd9892
Thanks @benjie! - Update dependencies (sometimes through major versions).
- #488
e916b7412
Thanks @benjie! - Fix issues with polymorphism when interacting with nodeIds, particularly in mutations and SQL functions. - Updated dependencies
[
95e902f54
,53186213a
,e916b7412
,73f1b5218
,109c8ec67
]:
-
#462
53f0488b1
Thanks @benjie! - Allow 'null' to be passed towithPgClient
/withPgClientTransaction
-
#460
07883a1a5
Thanks @benjie! - Fix makeExtendSchemaPlugin: now calls callback in 'init' phase, soBuild
type is used (rather thanPartial<Build>
) and other types/handlers/etc should already be registered. -
#463
22fa6230a
Thanks @benjie! - Add experimental support for h3 server to grafserv. -
#459
d17dd1cd4
Thanks @benjie! - Disable mutations for@interface mode:relational
tables. (They shouldn't have been enabled, and they don't work yet.) -
#464
00d026409
Thanks @benjie! -@dataplan/pg/adaptors/pg
now addsrawClient
property which is the underlying Postgres client for use withpgTyped
,zapatos
, and other libraries that can use a raw postgres client. This is exposed viaNodePostgresPgClient
interface which is a subtype ofPgClient
. -
Updated dependencies [
53f0488b1
,f9cc88dc4
,07883a1a5
,22fa6230a
,d17dd1cd4
,fa8cfcf9b
,00d026409
]:
- Updated dependencies
[
22ecd1e5d
]:
-
#454
196e5c1aa
Thanks @benjie! -@interface mode=single/relational
now getNode
interface if the table has a PK.馃毃
@interface mode=union
no longer getsNode
interface unless you also add@behavior node
. -
#454
e75bf57dd
Thanks @benjie! - Automatically register connection types for unionMember unions.
- Updated dependencies
[
23bd3c291
]:
-
Updated dependencies [
cbd987385
]:
-
#441
dfefdad3c
Thanks @benjie! - Change bundling techniques for grafast and @dataplan/pg -
#441
6c1c1a34f
Thanks @benjie! - Introduce _allRows base inflector used by allRowsConnection and allRowsList
-
#433
5491e10b0
Thanks @benjie! - Improve error messages from custom string scalars when they cannot be parsed as a string. -
#434
a9561d62d
Thanks @benjie! - Deprecatepreset.gather.pgJwtType
(tuple), instead usepreset.gather.pgJwtTypes
which expects a string and parses it similar to the PostgreSQL parser (and also allows multiple types to be specified). -
#433
232885703
Thanks @benjie! - Change type of pgJwtSecret and pgJwtSignOptions fromany
to the correct types. -
#438
db19ed9c3
Thanks @benjie! - When using@interface mode:relational
, don't add pointless relationships from concrete type back to abstract or from abstract to related concrete types. -
#438
31e776e03
Thanks @benjie! - Fix spurious error relating to connection for@interface type:relational
-
#436
055c4e438
Thanks @benjie! - Fix inflection of computed column field names in secondary schemas when using the V5 preset. Also, use underscores instead of dashes for the serviceName/schemaName separator for the names of the function resources, so that they can be typed manually rather than having to use string properties likeconst { ["myService-mySchema-my_function_name"]: myFunctionResource } = pgRegistry.pgResources
-
#435
cf32f0397
Thanks @benjie! - Fix bug in listOfCodec causing wrong extensions to be used in non-deterministic manner (thanks to @jvandermey for finding the bug and helping to track it down). -
#428
57d88b5fa
Thanks @benjie! - Fix bug exporting schema, and importing schema with __assertStep. -
#438
a22830b2f
Thanks @benjie! - Plugin name now automatically used inprovides
for every hook, allowing ordering hooks before/after their equivalents in other plugins. -
#422
9f87a26b1
Thanks @benjie! - Comments enabled in released packages -
#428
9695c65f8
Thanks @benjie! - Optimize away some unnecessary content from graphile-exported schema -
#428
c00a21cb9
Thanks @benjie! - Improve name and description of TagsFilePlugin -
#433
a5f224295
Thanks @benjie! - Addpostgraphile/presets/lazy-jwt
to handle boilerplate of JWT setup if the user doesn't want to do it themselves. -
Updated dependencies [
ea003ca3a
,5491e10b0
,a9561d62d
,232885703
,db19ed9c3
,31e776e03
,055c4e438
,cf32f0397
,57d88b5fa
,a22830b2f
,9f87a26b1
,9695c65f8
,c00a21cb9
]:
-
#421
415f436a0
Thanks @benjie! -@notNull
is now respected in PgAttributesPlugin for outputs as well as inputs. -
#421
5b8e46a8a
Thanks @benjie! - Breaking for types: movePg*Tags
toGraphileBuild.Pg*Tags
for easier declaration merging -
#421
bb64c090d
Thanks @benjie! - Newbuild.pgResolveOutputType
helper exported to aid plugins determining GraphQL output type from a codec (taken from PgAttributesPlugin).
-
#420
c1518fad0
Thanks @benjie! - Fix schema so it can run without NodePlugin -
Updated dependencies [
c1518fad0
]:
- Updated dependencies
[
d99d666fb
]:
-
#417
e7dd2e039
Thanks @benjie! -codec
is now baked into NodeId handlers (rather than usingcodecName
and looking that up incodecs
). All related APIs have thus simplified, e.g. the stepnode(codecs, handler, $id)
is nownode(handler, $id)
, etc. TypeScript should point out any issues you have hopefully. -
#417
620f9e07e
Thanks @benjie! - Grafast now supportsoperationsCacheMaxLength
andoperationOperationPlansCacheMaxLength
configuration viaschema.extensions.grafast.*
. Currently undocumented. -
#417
881672305
Thanks @benjie! -deepEval
has been renamed toapplyTransforms
-
#418
9ab2adba2
Thanks @benjie! - Overhaul peerDependencies and dependencies to try and eliminate duplicate modules error. -
#417
ff4395bfc
Thanks @benjie! - Grafast operation cache now tied to the schema, so multiple schemas will not cause degraded performance from clearing the cache. -
#417
502b23340
Thanks @benjie! -preset.grafast.context
second parameter is no longer the existing GraphQL context, but instead the GraphQL request details (which contains thecontextValue
). If you were using this (unlikely), add.contextValue
to usage of the second argument. -
#417
dc94b4a30
Thanks @benjie! - Rename 'postgraphilePresetAmber' to 'PostGraphileAmberPreset' -
#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 ofattribute: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 theentityBehaviors
system to add or remove the baseattribute:filterBy
(etc) behavior depending on what the type of the attribute is. -
Updated dependencies [
e7dd2e039
,620f9e07e
,f115b6fb2
,1882e0185
,881672305
,e5012f9a1
,9ab2adba2
,47f6f018b
,ff4395bfc
,502b23340
,4eda0cd57
]:
-
#406
bfe5997e3
Thanks @benjie! - Ability to control via behaviors whether the record type is selectable on CRUD mutation payloads. -
#407
9281a2d88
Thanks @benjie! - Exportedversion
no longer usesrequire('../package.json')
hack, instead the version number is written to a source file at versioning time. Packages now exportversion
. -
#406
903c04b3b
Thanks @benjie! - AddfilterBy
andorderBy
behaviors for each codec type (array, range, composite, binary, scalar) to allow simpler global customization. -
#406
c5eceba07
Thanks @benjie! - Incorrect ordering of behaviorsorderBy:array
/orderBy:range
fixed ->array:attribute:orderBy
/range:attribute:orderBy
. -
#407
9281a2d88
Thanks @benjie! - More accurate database identifier parser used in a couple places. -
#407
808af8af3
Thanks @benjie! - Allow marking relations as@notNull
-
#406
9f5a784c6
Thanks @benjie! - Introduce TypeScript CIF gatherConfig() to help typing thegather
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. -
#406
51414d328
Thanks @benjie! - Add support forbytea
datatype using newBase64EncodedBinary
scalar in GraphQL. -
#407
9281a2d88
Thanks @benjie! - Possible to set the modifier of an argument type via@arg0modifier
smart tag -
#408
bc14d488d
Thanks @benjie! - When sorting, specify a concrete locale to localeCompare to ensure stable ordering across machines. -
#408
dda361d11
Thanks @benjie! - Improve error messages for getInputTypeByName and getOutputTypeByName. -
Updated dependencies [
f5dd38aa3
,bfe5997e3
,9281a2d88
,903c04b3b
,c5eceba07
,675b7abb9
,c5050dd28
,9281a2d88
,808af8af3
,9f5a784c6
,2849cc3fb
,8ca9425ed
,51414d328
,a298fc893
,1300a9753
,088d83b1d
,0d1782869
,9281a2d88
,bc14d488d
,dda361d11
]:
-
#402
70b2c3900
Thanks @benjie! - pgCodecAttribute behavior now uses attributeName rather than attribute spec in the callback (BREAKING) -
#402
37d829b89
Thanks @benjie! - Ability to control whether the nodeId or regular column CRUD mutations are used -
#402
ff91a5660
Thanks @benjie! - Addedpostgraphile/presets/relay
preset:- Hides primary key columns from output schema, and includes
id: ID
instead - Hides foreign key columns from output schema, expecting you to use the relation instead
- Hides columns that are part of the primary key from update/delete mutations (but still present for create if the column is writeable - it shouldn't be)
- Hides columns that are part of a foreign key from CRUD mutations/filters,
instead exposes the
ID
for the remote side of the relation - Does not allow ordering by individual primary key columns (though you can
still order by
PRIMARY_KEY_ASC
/DESC
) - Does not allow ordering by individual foreign key columns
- Turns off the row fetchers that don't use the node
ID
- Turns off the CRUD mutations that don't use the node
ID
- Functions can now use
@arg0variant nodeId
to indicate the first argument (increase the0
for other arguments) should accept a nodeID
(this currently only works where the argument type is a table type) - Removes relations from mutation payloads, these should be traversed via the record instead (they're redundant)
Most of these changes are reversible, so for example if you really want to turn back on
Query.userByUsername
you can do so by adding the+connection
behavior to the "unique username" constraint on theusers
table. - Hides primary key columns from output schema, and includes
-
#402
644938276
Thanks @benjie! - Usefile://
URLs in import() to fix compatibility with Windows (e.g. when loadinggraphile.config.mjs
) -
#402
47365f0df
Thanks @benjie! - Add helper for more easily handling NodeIDs for known typeName. -
#402
339cb005e
Thanks @benjie! - Remove relations from mutation payloads (unless using V4 preset) - they're redundant. -
Updated dependencies [
70b2c3900
,37d829b89
,ff91a5660
,644938276
,47365f0df
,339cb005e
]:
-
#396
17fe531d7
Thanks @benjie! - pgUnionAll uses a slightly more optimal SQL (where JSON isn't cast to::text
and then back to::json
) -
#398
b7533bd4d
Thanks @benjie! - Incremental delivery will no longer deliver payloads for paths that don't exist when an error is thrown in an output plan. -
#376
326aa99cd
Thanks @benjie! - Can now give constraints separate forward/backward behaviors -
#385
7c5a0fe3a
Thanks @benjie! - makeV4Preset is now typed to support arbitrary schema options (it already supported this, but the types didn't allow it). -
#396
b5eb7c490
Thanks @benjie! - Cursor pagination over nullable columns should now work, although it is untested. -
#399
976958e80
Thanks @benjie! - Plugins can now use build.grafast rather than adding grafast as a peerDependency. -
#399
e0f322b79
Thanks @benjie! - Re-export dependencies atpostgraphile/{depName}
e.g.postgraphile/@dataplan/pg
so exports can be used without peerDependency/hoisting issues. -
#396
7573bf374
Thanks @benjie! - Address a decent number of TODO/FIXME/etc comments in the codebase. -
#378
95b2ab41e
Thanks @benjie! - Support for nested arrays via PostgreSQL domains. -
#386
8230fcaeb
Thanks @benjie! - If an issue occurs whilst retrieving attributes for a constraint, we now log an error and return an empty array. -
#398
c43802d74
Thanks @benjie! - Fix a number of issues relating to incremental delivery and iterators -
#398
b118b8f6d
Thanks @benjie! - Incremental delivery@stream
now works for regular steps as well as streamable steps. -
#396
b66d2503b
Thanks @benjie! - hasNextPage (via hasMore) now uses an access plan rather than a lambda plan. -
#401
b868aa63f
Thanks @benjie! - AddedBuild.dataplanPg
so plugins don't need to import this module. -
#396
3caaced6c
Thanks @benjie! - When fetching a single row, anORDER BY
clause will no longer be added. -
Updated dependencies [
659508371
,409581534
,4d64ac127
,17fe531d7
,b7533bd4d
,326aa99cd
,56b52295c
,9238d3ce4
,9feb769c2
,b5eb7c490
,976958e80
,7573bf374
,95b2ab41e
,2c8586b36
,8230fcaeb
,6f545683c
,c43802d74
,b118b8f6d
,b66d2503b
,9008c4f87
,47ff7e824
,b868aa63f
,e8c81cd20
,3caaced6c
,9f2507ed9
]:
-
#349
a94f11091
Thanks @benjie! - Overhaul behavior systemPreviously 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 differentsomeCondition()
under which the "filter" behavior would apply by default, whereas the built incondition
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.
-
#355
1fe47a2b0
Thanks @benjie! - MAJOR BREAKING CHANGE: implicit application of args/input fields has been removed.Previously we would track the fieldArgs that you accessed (via
.get()
,.getRaw()
or.apply()
) and those that you did not access would automatically have theirapplyPlan
called, if they had one. This isn't likely to be particularly useful for pure Grafast users (unless they want to adopt this pattern) but it's extremely useful for plugin-based schemas as it allows plugins to add arguments that can influence their field's plan without having to wrap the field's plan resolver function. This is fairly critical, otherwise each behavior added (first:
,condition:
,orderBy:
,filter:
,ignoreArchived:
, etc etc) would wrap the plan resolver with another function layer, and they would get messy.However, implicit is rarely good. And it turns out that it severely limited what I wanted to do for improving the
fieldArgs
APIs.I decided to remove this implicit functionality by making it more explicit, so now args/input fields can specify the relevant
autoApplyAfterParent{Plan,SubscribePlan,InputPlan,ApplyPlan}: true
property and we'll only apply them at a single level.From a user perspective, little has changed. From a plugin author perspective, if you were relying on the implicit
applyPlan
then you should now add the relevantautoApply*
property next to yourapplyPlan
method. -
#363
bcfffd5fe
Thanks @benjie! - Fix bug causing@foreignKey
relation to not show up under rare circumstances (by updating PgRelationsPlugin to use codec, not resource, as the primary entity). -
#362
e443db39b
Thanks @benjie! - Use original case for table resource names. -
Updated dependencies [
56237691b
,ed1982f31
,a94f11091
,1fe47a2b0
,198ac74d5
,6878c589c
,2ac706f18
,77e011294
,bcfffd5fe
,dad4d4aae
,e443db39b
]:
- Updated dependencies
[
dd3ef599c
]:
-
#346
9ddaaaa96
Thanks @benjie! - Fix a bug in subscriptions where variables were not recognized -
#345
3a984718a
Thanks @benjie! - Cursor validation errors are now raised by the connection directly, rather than the subfields. -
#340
fe9154b23
Thanks @benjie! - Make Datetime RFC3339 compatible when a timezone is present -
Updated dependencies [
5c9d32264
,9ddaaaa96
,2fcbe688c
,3a984718a
,fe9154b23
,adc7ae5e0
]:
-
#338
dcc3d0355
Thanks @benjie! -@interface mode:union
interfaces now also gain root fields. -
#339
f75926f4b
Thanks @benjie! - CRITICAL BUGFIX: mistake in optimization of list() can lead to arrays being truncated -
#338
ca1526b70
Thanks @benjie! - Fix startCursor/endCursor for connections using pgUnionAll steps. -
#338
3426b0f4a
Thanks @benjie! - Fix bugs in pgUnionAll connections relating to PageInfo -
Updated dependencies [
dcc3d0355
,f75926f4b
,ca1526b70
,3426b0f4a
]:
-
#335
ef8432511
Thanks @benjie! - Have ref fields support ordering and filtering. -
#336
24822d0dc
Thanks @benjie! - Fix over-cautious throw when dealing with recursive inputs. -
Updated dependencies [
ef8432511
,86e503d78
,2850e4732
,24822d0dc
]:
-
Updated dependencies [
1ea7acdf5
]:- [email protected]
- @dataplan/[email protected]
-
#332
faa1c9eaa
Thanks @benjie! - Adjust dependencies and peerDependencies and peerDependenciesMeta. -
Updated dependencies [
faa1c9eaa
]:
-
7f857950a
Thanks @benjie! - Upgrade to the latest TypeScript/tslib -
9605165d5
Thanks @benjie! - Fix naming conflict that occurs with@enum
smart tag when not using@enumName
. NewenumTableEnum
inflector. -
Updated dependencies [
21e95326d
,98ae00f59
,2389f47ec
,2fe247f75
,e91ee201d
,865bec590
,7f857950a
,9605165d5
,d39a5d409
]:
-
#305
3cf35fdb4
Thanks @benjie! - 馃毃 Ruru is now a CommonJS module, no longer an ESM module.Ruru CLI now reads options from a
graphile.config.ts
file if present.It's now possible to customize the HTML that Ruru is served with (specifically the meta, title, stylesheets, header JS, body content, body JS, and init script), either via configuration:
import { defaultHTMLParts } from "ruru/server"; const preset: GraphileConfig.Preset = { //... ruru: { htmlParts: { titleTag: "<title>GraphiQL with Grafast support - Ruru!</title>", metaTags: defaultHTMLParts.metaTags + `<meta name="viewport" content="width=device-width, initial-scale=1" />`, }, }, };
or via a plugin, which allows you to change it on a per-request (per-user) basis:
const RuruMetaPlugin: GraphileConfig.Plugin = { name: "RuruMetaPlugin", version: "0.0.0", grafserv: { hooks: { ruruHTMLParts(_info, parts, extra) { // extra.request gives you access to request details, so you can customize `parts` for the user parts.metaTags += `<meta name="viewport" content="width=device-width, initial-scale=1" />`; }, }, }, };
-
#307
7c45eaf4e
Thanks @benjie! - 馃毃 'application/x-www-form-urlencoded' is now opt-in (unless you're using the V4 preset).CSRF and CORS are tricky topics. When you use PostGraphile as part of a larger system, it's your responsibility to ensure that you don't open yourself up to CSRF/etc issues (e.g. by using CSRF/XSRF tokens, by using
SameSite
cookie policies, by checking theOrigin
of requests, or by using a combination of these or other techniques).Out of the box, PostGraphile does not use cookies, so any cross-origin requests are harmless because an attacker without the actual user token in hand can only execute unauthenticated requests.
However, once cookies (and sessions) enter the equation, suddenly CSRF becomes a risk. Normally you cannot submit an
Content-Type: application/json
request cross origins (unless you've enabled CORS), so this content type doesn't open CSRF issues on its own, butContent-Type: application/x-www-form-urlencoded
can be submitted cross origins without CORS policies. The attacker won't be able to view the response, but that doesn't mean they can't cause havoc by triggering dangerous mutations using the user's credentials.We've decided to take the stance of making
application/x-www-form-urlencoded
opt-in; you can opt-in via your graphile.config.ts (or equivalent) like so:import { DEFAULT_ALLOWED_REQUEST_CONTENT_TYPES } from "grafserv"; const preset: GraphileConfig.Preset = { //... grafserv: { //... allowedRequestContentTypes: [ ...DEFAULT_ALLOWED_REQUEST_CONTENT_TYPES, "application/x-www-form-urlencoded", ], }, };
If you're using the V4 preset then we pull in the V4 behavior of enabling this content type by default (since you presumably already have protections in place); however we recommend disabling this media type if you're not using it:
import { DEFAULT_ALLOWED_REQUEST_CONTENT_TYPES } from "grafserv"; const preset: GraphileConfig.Preset = { //... extends V4 preset ... grafserv: { //... allowedRequestContentTypes: DEFAULT_ALLOWED_REQUEST_CONTENT_TYPES, }, };
Note that this media type is not currently part of the GraphQL-over-HTTP specification so disabling it does not make your server non-compliant.
-
759ad403d
Thanks @benjie! - Alpha release - see https://postgraphile.org/news/2023-04-26-version-5-alpha -
Updated dependencies [
759ad403d
]:
-
#297
90ed0cb7a
Thanks @benjie! - Overhaul websocket handling in Grafserv providing cleaner integration with Grafast. -
#297
56be761c2
Thanks @benjie! - Grafserv now has a plugin system (via graphile-config), first plugin hook enables manipulating the incoming request body which is useful for persisted operations. -
Updated dependencies [
90ed0cb7a
,56be761c2
,8d270ead3
,1a012bdd7
,b4eaf89f4
]:
- Updated dependencies
[
7dcb0e008
]:
-
#279
2df36c5a1
Thanks @benjie! -description
moved out ofextensions
to live directly on all the relevant entities. -
#279
a73f9c709
Thanks @benjie! -PgConnectionArgFirstLastBeforeAfterPlugin
is nowPgFirstLastBeforeAfterArgsPlugin
(because it applies to lists as well as connections).PgInsertStep
/pgInsert()
/PgUpdateStep
/pgUpdate()
/PgDeleteStep
/pgDelete()
are nowPgInsertSingleStep
/pgInsertSingle()
/PgUpdateSingleStep
/pgUpdateSingle()
/PgDeleteSingleStep
/pgDeleteSingle()
(to make space to add a future bulk API if we want to).config.schema.orderByNullsLast
is nowconfig.schema.pgOrderByNullsLast
for consistency (V4 preset users are unaffected). Lots of field scopes ingraphile-build-pg
have been updated to incorporatefield
into their names. -
#267
159735204
Thanks @benjie! - Add formatting for SQL aliases -
#270
ef42d717c
Thanks @benjie! - SQL is now generated in a slightly different way, helping PostgreSQL to optimize queries that have a batch size of 1. Also removes internal mapping code as we now simply append placeholder values rather than search and replacing a symbol (eradicatesqueryValuesSymbol
and related hacks). If you manually issue queries throughPgExecutor
(extremely unlikely!) then you'll want to check out PR #270 to see the differences. -
#260
d5312e6b9
Thanks @benjie! - TypeScript v5 is now required -
#285
bd37be707
Thanks @benjie! - Single table inheritance no longer exposes non-shared columns via condition/order, and also only exposes the relationships on the types where they are appropriate. -
#270
f8954fb17
Thanks @benjie! -EXPLAIN ANALYZE
(forSELECT
) andEXPLAIN
(for other operations) support added. Currently requiresDEBUG="datasource:pg:PgExecutor:explain"
to be set. Publish this through all the way to Ruru. -
#260
96b0bd14e
Thanks @benjie! -PgSource
has been renamed toPgResource
,PgTypeCodec
toPgCodec
,PgEnumTypeCodec
toPgEnumCodec
,PgTypeColumn
toPgCodecAttribute
(and similar for related types/interfaces).source
has been replaced byresource
in various of the APIs where it relates to aPgResource
.PgSourceBuilder
is no more, instead being replaced withPgResourceOptions
and being built into the finalPgResource
via the newmakeRegistryBuilder
/makeRegistry
functions.build.input
no longer contains thepgSources
directly, insteadbuild.input.pgRegistry.pgResources
should be used.The new registry system also means that various of the hooks in the gather phase have been renamed/replaced, there's a new
PgRegistryPlugin
plugin in the default preset. The only plugin that uses themain
method in thegather
phase is nowPgRegistryPlugin
- if you are using themain
function for Postgres-related behaviors you should consider moving your logic to hooks instead.Plugin ordering has changed and thus the shape of the final schema is likely to change (please use
lexicographicSortSchema
on your before/after schemas when comparing).Relationships are now from a codec to a resource, rather than from resource to resource, so all the relationship inflectors (
singleRelation
,singleRelationBackwards
,_manyRelation
,manyRelationConnection
,manyRelationList
) now accept different parameters ({registry, codec, relationName}
instead of{source, relationaName}
).Significant type overhaul, most generic types no longer require generics to be explicitly passed in many circumstances.
PgSelectStep
,PgSelectSingleStep
,PgInsertStep
,PgUpdateStep
andPgDeleteStep
now all accept the resource as their single type parameter rather than accepting the 4 generics they did previously.PgClassExpressionStep
now accepts just a codec and a resource as generics.PgResource
andPgCodec
have gained a newTName extends string
generic at the very front that is used by the registry system to massively improve continuity of the types through all the various APIs.Fixed various issues in schema exporting, and detect more potential issues/oversights automatically.
Fixes an RBAC bug when using superuser role for introspection.
-
#271
d951897ee
Thanks @benjie! - Add extensions.pg to Postgres function resources (makes it easier for plugins to hook them). -
#270
c564825f3
Thanks @benjie! -set jit = 'off'
replaced withset jit_optimize_above_cost = -1
so that JIT can still be used but heavy optimization costs are not incurred. -
#286
366b166dc
Thanks @benjie! - Add detection for@ref
that is missingsingular
, fix docs and test schema and add tests for same. -
#271
261eb520b
Thanks @benjie! - 馃毃 RENAME ALL THE THINGSThe 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 relatedpgConfig
terms such asmakePgConfig
->makePgService
,MakePgConfigOptions
->MakePgServiceOptions
, etc) - see yourgraphile.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 thepgServices
(which waspgConfigs
) 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
-
#266
395b4a2dd
Thanks @benjie! - The Grafast step class 'execute' and 'stream' methods now have a new additional first argumentcount
which indicates how many results they must return. This means we don't need to rely on thevalues[0].length
trick to determine how many results to return, and thus we can pass through an empty tuple to steps that have no dependencies. -
#268
a14cf5f4c
Thanks @benjie! - PgV4NoIgnoreIndexesPlugin is now PgIndexBehaviorsPlugin, moved to graphile-build-pg, and is enabled by default -
Updated dependencies [
2df36c5a1
,c5d89d705
,a73f9c709
,ae304b33c
,159735204
,ef42d717c
,d5312e6b9
,22ec50e36
,0f4709356
,c22dcde7b
,bd37be707
,f8954fb17
,96b0bd14e
,d951897ee
,fbf1da26a
,c564825f3
,366b166dc
,261eb520b
,395b4a2dd
,a14cf5f4c
,f6e644bd3
]:
-
#257
89d16c972
Thanks @benjie! - PgClassSinglePlan is now enforced, users will be informed if plans return a step incompatible with the given GraphQL object type. -
#257
8f323bdc8
Thanks @benjie! - When multiple versions of grafast or pg-sql2 are detected, a warning will be raised. -
#257
dd5464e39
Thanks @benjie! -@omit read
on a column now omits constraints using that column, as it did in V4. -
Updated dependencies [
89d16c972
,8f323bdc8
,9e7183c02
,fce77f40e
,612092359
]:
-
#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
11e7c12c5
Thanks @benjie! - Solve mutation issue in plugin ordering code which lead to heisenbugs. -
#233
2f50a633a
Thanks @benjie! - Fix a bug where plugin ordering could result in update mutations not being created. -
#233
005e5cea0
Thanks @benjie! - Eradicate PgSmartCommentsPlugin, it is no longer needed. Solves some plugin ordering issues. -
Updated dependencies [
a50bc5be4
,6fb7ef449
,11e7c12c5
,2f50a633a
,005e5cea0
]:
-
#229
f5a04cf66
Thanks @benjie! - 馃毃 BREAKING CHANGEhookArgs()
now accepts arguments in the same order asgrafast()
:hookArgs(args, resolvedPreset, ctx)
. Please update all yourhookArgs
calls. -
#229
a06b8933f
Thanks @benjie! - Rename 'eventStreamRoute' to 'eventStreamPath' for consistency with 'graphqlPath' and 'graphiqlPath'. V4 preset unaffected. -
#229
ac6137bb6
Thanks @benjie! - 馃毃 PgRBACPlugin is now included in the defaultgraphile-build-pg
(and thus PostGraphile amber) preset. Users of the V4 preset are unaffected. -
#229
9edf7511a
Thanks @benjie! - 馃毃 pgl.getServerParams() has been renamed to pgl.getSchemaResult() -
Updated dependencies [
f5a04cf66
,13cfc7501
,b795b3da5
,a06b8933f
,b9a2236d4
,ac6137bb6
]:
-
#226
2a7c682f4
Thanks @benjie! - Enable websockets and add better compatibility with V4's pgSettings/additionalGraphQLContextFromRequest for websockets when usingmakeV4Preset({subscriptions: true})
. -
#226
6a846e009
Thanks @benjie! - Enable users to use Grafserv alongside other websocket-enabled entities in their final server.
- Updated dependencies
[
397e8bb40
]:
-
#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.
-
Updated dependencies [
4c2b7d1ca
,2abc58cf6
,c8a56cdc8
,df8c06657
]:
-
#218
f2c1423fb
Thanks @benjie! - Option for@foreignKey
smart tag to have unique auto-created for it to ease transition from V4:{ gather: { pgFakeConstraintsAutofixForeignKeyUniqueness: true } }
-
#219
b58f5dfac
Thanks @benjie! - RenameGraphileBuild.GraphileBuildGatherOptions
toGraphileBuild.GatherOptions
. RenameGraphileBuild.GraphileBuildInflectionOptions
toGraphileBuild.InflectionOptions
.
- Updated dependencies [
f48860d4f
]:
a8d26b30a
-ignoreReplaceIfNotExists
now truly ignores replacement inflectors. Better handle disabled NodePlugin.- Updated dependencies [
a8d26b30a
]:
-
#210
2fb5001b4
Thanks @benjie! - retryOnInitFail implemented, and bug in introspection cache on error resolved. -
#210
2bd4b619e
Thanks @benjie! - Addextensions.pg = { databaseName, schemaName, name }
to various DB-derived resources (codecs, sources, etc); this replaces theoriginalName
temporary solution that we had previously. -
#210
b523118fe
Thanks @benjie! - Replace BaseGraphQLContext with Grafast.Context throughout. -
Updated dependencies [
2fb5001b4
,2bd4b619e
,b523118fe
,461c03b72
]:
9a6b18fd9
- Give postgraphile() a named return type and export the V4 plugins from the V4 preset.
-
#207
c850dd4ec
Thanks @benjie! - Rename 'preset.server' to 'preset.grafserv'. -
#207
afa0ea5f6
Thanks @benjie! - Fix bug in subscriptions where termination of underlying stream wouldn't terminate the subscription. -
#206
851b78ef2
Thanks @benjie! - Grafserv now masks untrusted errors by default; trusted errors are constructed via GraphQL's GraphQLError or Grafast's SafeError. -
Updated dependencies [
d76043453
,c850dd4ec
,afa0ea5f6
,92c2378f2
,851b78ef2
,384b3594f
]:
- Updated dependencies [
e5b664b6f
]:
-
#200
1e5671cdb
Thanks @benjie! - Add support for websocket GraphQL subscriptions (via graphql-ws) to grafserv and PostGraphile (currently supporting Node, Express, Koa and Fastify) -
#200
5b634a78e
Thanks @benjie! - Standardize onserv.addTo
interface, even for Node -
Updated dependencies [
4f5d5bec7
,e11698473
,1e5671cdb
,fb40bd97b
,a1158d83e
,5b634a78e
,25f5a6cbf
]:
-
0ab95d0b1
- Update sponsors. -
#196
af9bc38c8
Thanks @benjie! - Allow passingpool
directly tomakePgConfig
. -
#190
652cf1073
Thanks @benjie! - 馃毃 Breaking changes around types and postgres configuration:GraphileBuild.GraphileResolverContext
renamed toGrafast.Context
GraphileConfig.GraphQLRequestContext
renamed toGrafast.RequestContext
Grafast.PgDatabaseAdaptorOptions
renaed toGraphileConfig.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 identifiermakePgConfigs
:- 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 onpg
) - 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
- is now
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 useGrafast.RequestContext.node.req/res
; all server adaptors should implement this if appropriate
-
#192
80091a8e0
Thanks @benjie! - - Conflicts inpgConfigs
(e.g. multiple sources using the same 'name') now detected and output- Fix defaults for
pgSettingsKey
andwithPgClientKey
based on config name makePgConfig
now allows passingpgSettings
callback andpgSettingsForIntrospection
config object- Multiple postgres sources now works nicely with multiple
makePgConfig
calls
- Fix defaults for
-
Updated dependencies [
0ab95d0b1
,af9bc38c8
,4783bdd7c
,652cf1073
,752ec9c51
,80091a8e0
]:
-
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
orconstraint:source:update
orattribute:update
rather than justupdate
- 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)
- Adds
-
Updated dependencies [
72bf5f535
]:
- #184
842f6ccbb
Thanks @benjie! - Handle array-to-object issue in graphile-config when multiple presets set an array key. - Updated dependencies
[
842f6ccbb
]:
-
#183
ebb24895c
Thanks @benjie! - Fix bug when handling stable void functions -
#181
d3cba220c
Thanks @benjie! -*FieldName
smart tags are now used verbatim rather than being piped throughinflection.camelCase(...)
- you've explicitly stated a 'field name' so we should use that. This may be a breaking change for you if your field names are currently different before/after they are camelCase'd. -
#183
3eb9da95e
Thanks @benjie! - Fix potential construction loop on failure to construct a type
-
#178
1b040b3ba
Thanks @benjie! -@omit
and similar smart tags are now processed on@foreignKey
and other fake constraints. -
#176
19e2961de
Thanks @benjie! - Better graphile.config.* compatibility with ESM-emulation, so 'export default preset;' should work in TypeScript even if outputting to CommonJS. -
#177
6be68a53e
Thanks @benjie! -@foreignFieldName
smart tag is now fed into theinflection.connectionField(...)
orinflection.listField(...)
inflector as appropriate. If you are using@foreignSimpleFieldName
you may be able to delete that now; alternatively you should consider renaming@foreignFieldName
to@foreignConnectionFieldName
for consistency. -
Updated dependencies [
1b040b3ba
,19e2961de
,6be68a53e
,11d6be65e
]:
- Updated dependencies
[
208166269
]:
-
af9f11f28
Thanks @benjie! - 'preset.pgSources' renamed to 'preset.pgConfigs' to avoid confusion with PgSource class and 'input.pgSources' used for build. -
6ebe3a13e
Thanks @benjie! - Enable omitting update/delete mutations using behaviors on unique constraints. -
0e440a862
Thanks @benjie! - Add new--superuser-connection
option to allow installing watch fixtures as superuser. -
f7d885527
Thanks @benjie! - Fix bug in server startup message where preset.server.graphqlPath was not respected.
c4213e91d
- Add pgl.getResolvedPreset() API; fix Ruru respecting graphqlPath setting; replace 'instance' with 'pgl'/'serv' as appropriate; forbid subscriptions on GET- Updated dependencies [
c4213e91d
]:
-
9b296ba54
- More secure, more compatible, and lots of fixes across the monorepo -
Updated dependencies [
9b296ba54
]:
- Updated dependencies [
cd37fd02a
]:
- Updated dependencies [
768f32681
]:
- Updated dependencies [
0983df3f6
]:
d7b87b325
- Fix importing presets
- Updated dependencies [
9ebe3d860
]:- @dataplan/[email protected]
- [email protected]
- Updated dependencies [
bf83f591d
]:- @dataplan/[email protected]
- [email protected]
- Updated dependencies [
55f15cf35
]:
-
Updated dependencies [
91f2256b3
]: