- 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. -
#2051
45e10950b
Thanks @benjie! - Resource options now marked EXPORTABLE after hooks called, enabling more plugins to be exportable. -
#2050
272608c13
Thanks @benjie! - Add missing EXPORTABLE (and remove excessive EXPORTABLE) to fix schema exports. -
#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. -
Updated dependencies [
357d475f5
,30bcd6c12
,3551725e7
,80836471e
,b788dd868
,a5c20fefb
,1ce08980e
,ab08cbf9c
,dff4f2535
,a287a57c2
,2fe56f9a6
,fed603d71
,ed6e0d278
,86168b740
,7ad35fe4d
,e82e4911e
,94a05064e
,272608c13
,7606a5b87
,42ece5aa6
,e0d69e518
,db8ceed0f
,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. -
#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. -
Updated dependencies [
9f85c614d
,6c6be29f1
,6c80c44b7
,179d25b09
,8315e8d01
,9d53dde72
,46d8289b4
]:
-
#1933
3a2ea80ee
Thanks @mattiarossi! -eslint-plugin-graphile-export
now spots instances ofinputPlan
,applyPlan
andassertStep
so they can be checked - thanks @mattiarossi! -
#1935
8ea67f891
Thanks @benjie! - Fix lots of things related to exporting a schema withgraphile-export
. -
#1935
e20e66ed7
Thanks @benjie! - Make even more of the schema exportable, including handling scalars with no parseLiteral definition. -
Updated dependencies [
49fd8afed
,00d32d887
,63dd7ea99
,c62eee10b
,d801c9778
,3a2ea80ee
,ef44c29b2
,8ea67f891
,5de3e86eb
,e20e66ed7
]:
-
#1904
5b2db0c75
Thanks @benjie! - Add pgRefDetails to scope for some ref-generated fields, to enable plugins to hook them. -
#1905
184773382
Thanks @benjie! - Enable specifying the polymorphic subtype a function returns via@returnType MyType
smart tag. -
Updated dependencies [
555a2be03
,1b6c2f636
,a2176ea32
,886833e2e
,f97d7976a
]:
-
#1884
bce0636d4
Thanks @benjie! - Fixes multiple pgServices codec name conflicts by prepending the service name if it's not 'main'. -
#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. -
#1875
3b558e0c1
Thanks @enisdenjo! - Consider attribute'sisNotNull
flag for polymorphic types -
#1884
2ae8d33aa
Thanks @benjie! - Fixes missing await which might cause process to exit when something goes wrong during schema building. -
#1885
9e1df08b7
Thanks @benjie! - FixorderBy:null
regression -
#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. -
#1879
dbd91fdd8
Thanks @benjie! - Move PgContextPlugin from graphile-build-pg into @dataplan/pg so it can be used after schema export without needing dependency on graphile-build-pg -
#1841
f1d5ad18e
Thanks @benjie! - Make smart tags parser more forgiving (track parenthesis) -
#1884
c66c3527c
Thanks @benjie! - List codecs can now have names. -
#1876
9fb5cc06e
Thanks @enisdenjo! - Specifyfrom
in@ref
to apply refs to a single type -
Updated dependencies [
3fdc2bce4
,aeef362b5
,8a76db07f
,f305c3278
,8a0cdb95f
,dbd91fdd8
,c66c3527c
,f66cc40b3
,f18635a5c
,1c9f1c0ed
]:
- #1834
2e7fc6449
Thanks @benjie! - Fix issue with watch mode where schema omits database resources in some situations. - Updated dependencies
[
49fcb0d58
,7aef73319
]:
- #1801
2d447a6b4
Thanks @benjie! - Fix bug where the owner of a database object wasn't seen as having any privileges. - Updated dependencies
[
2d447a6b4
]:- [email protected]
- @dataplan/[email protected]
-
#1797
26e0bc726
Thanks @benjie! - Fix that smart tags were not copied onto enum codecs. -
Updated dependencies [
26e0bc726
]:- @dataplan/[email protected]
- Updated dependencies
[
2805edc68
]:
-
#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. -
#1769
b728d7fb9
Thanks @benjie! - Fix error message when ref is used with no foreign key. -
#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 [
4a4d26d87
,b2bce88da
,861a8a306
,9a84bc6dd
,b728d7fb9
]:
-
#514
c9848f693
Thanks @benjie! - Update package.json repository information -
Updated dependencies [
c9848f693
,ede1092fe
,566983fbd
,409bf6071
]:
- Updated dependencies
[
3700e204f
]:
-
#488
e916b7412
Thanks @benjie! - Fix issues with polymorphism when interacting with nodeIds, particularly in mutations and SQL functions. -
#488
109c8ec67
Thanks @benjie! - Add new pgTableResource helper and refactor a lot of code to use it, reducing code in many cases
-
#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
.
-
#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 [
196e5c1aa
]:- [email protected]
- @dataplan/[email protected]
- 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 -
Updated dependencies [
dfefdad3c
]:
-
#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. -
#428
9695c65f8
Thanks @benjie! - Optimize away some unnecessary content from graphile-exported schema -
Updated dependencies [
ea003ca3a
,5491e10b0
,cf32f0397
,57d88b5fa
,a22830b2f
,9f87a26b1
]:
-
#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
f115b6fb2
Thanks @benjie! - ExportparseDatabaseIdentifier
-
#417
881672305
Thanks @benjie! -deepEval
has been renamed toapplyTransforms
-
#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 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
,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. -
#406
51414d328
Thanks @benjie! - Add support forbytea
datatype using newBase64EncodedBinary
scalar in GraphQL. -
#406
a298fc893
Thanks @benjie! - Fix constraint finding for polymorphism (was theoretically possible to find the wrong constraint). -
#407
1300a9753
Thanks @benjie! - Move attribute logic from PgConditionArgumentPlugin to PgAttributesPlugin -
#407
9281a2d88
Thanks @benjie! - Possible to set the modifier of an argument type via@arg0modifier
smart tag -
#408
dda361d11
Thanks @benjie! - Improve error messages for getInputTypeByName and getOutputTypeByName. -
Updated dependencies [
f5dd38aa3
,9281a2d88
,675b7abb9
,c5050dd28
,9f5a784c6
,2849cc3fb
,8ca9425ed
,51414d328
,088d83b1d
,0d1782869
,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
339cb005e
Thanks @benjie! - Remove relations from mutation payloads (unless using V4 preset) - they're redundant.
-
#399
409581534
Thanks @benjie! - Change many of the dependencies to be instead (or also) peerDependencies, to avoid duplicate modules. -
#396
17fe531d7
Thanks @benjie! - pgUnionAll uses a slightly more optimal SQL (where JSON isn't cast to::text
and then back to::json
) -
#376
326aa99cd
Thanks @benjie! - Can now give constraints separate forward/backward behaviors -
#400
9238d3ce4
Thanks @benjie! - Usefile://
URLs in import() to fix compatibility with Windows (e.g. when loadinggraphile.config.mjs
). -
#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. -
#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. -
#383
2c8586b36
Thanks @benjie! - Change 'objectType.extensions.grafast.Step' to 'objectType.extensions.grafast.assertStep', accept it via object spec, deprecate registerObjectType form that accepts it (pass via object spec instead), improve typings around it. -
#378
6f545683c
Thanks @benjie! - Fix bug handling domains over composite types. -
#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. -
#396
9f2507ed9
Thanks @benjie! - Codecs can now (optionally) have executors associated (typically useful for record codecs); so we've eradicated runtime resource definition for columns that use composite types (or lists thereof) - all composite types accessible from attributes are now guaranteed to have a table-like resource generated in the registry. -
Updated dependencies [
659508371
,409581534
,4d64ac127
,17fe531d7
,b7533bd4d
,56b52295c
,9feb769c2
,b5eb7c490
,976958e80
,7573bf374
,95b2ab41e
,2c8586b36
,8230fcaeb
,c43802d74
,b118b8f6d
,b66d2503b
,9008c4f87
,47ff7e824
,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 [
339fe20d0
,56237691b
,ed1982f31
,a94f11091
,1fe47a2b0
,198ac74d5
,6878c589c
,2ac706f18
,77e011294
,dad4d4aae
,e443db39b
]:
- Updated dependencies
[
dd3ef599c
]:
-
#341
2fcbe688c
Thanks @benjie! - Ensure interfaces with zero implementations don't cause a crash. -
Updated dependencies [
5c9d32264
,2fcbe688c
,3a984718a
,fe9154b23
,adc7ae5e0
]:
-
#338
dcc3d0355
Thanks @benjie! -@interface mode:union
interfaces now also gain root fields. -
#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 [
1ea7acdf5
]:- @dataplan/[email protected]
-
#332
faa1c9eaa
Thanks @benjie! - Adjust dependencies and peerDependencies and peerDependenciesMeta. -
Updated dependencies [
faa1c9eaa
]:- [email protected]
- @dataplan/[email protected]
-
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
,87e6c65a7
,2389f47ec
,82cc01152
,e91ee201d
,865bec590
,7f857950a
,d39a5d409
]:
- Updated dependencies
[
3df3f1726
]:
-
759ad403d
Thanks @benjie! - Alpha release - see https://postgraphile.org/news/2023-04-26-version-5-alpha -
Updated dependencies [
759ad403d
]:
- #297
b4eaf89f4
Thanks @benjie! - AsyncHooks can now execute synchronously if all registered hooks are synchronous. May impact ordering of fields/types in GraphQL schema. - Updated dependencies
[
8d270ead3
,b4eaf89f4
]:
- Updated dependencies
[
7dcb0e008
]:
-
#279
2df36c5a1
Thanks @benjie! -description
moved out ofextensions
to live directly on all the relevant entities. -
#287
c5d89d705
Thanks @benjie! - Fix the type definition of GatherHooks to allow plugins to indicate individual gather hook ordering. -
#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. -
#260
d5312e6b9
Thanks @benjie! - TypeScript v5 is now required -
#259
c22dcde7b
Thanks @benjie! - RenamedrecordType
codec factory torecordCodec
.recordCodec()
now only accepts a single object argument. RenamedenumType
codec factory toenumCodec
.enumCodec()
now only accepts a single object argument. RenamelistOfType
tolistOfCodec
.Massive overhaul of PgTypeCodec, PgTypeColumn and PgTypeColumns generics - types should be passed through much deeper now, but if you reference any of these types directly you'll need to update your code.
-
#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. -
#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). -
#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
-
#268
a14cf5f4c
Thanks @benjie! - PgV4NoIgnoreIndexesPlugin is now PgIndexBehaviorsPlugin, moved to graphile-build-pg, and is enabled by default -
Updated dependencies [
2df36c5a1
,c5d89d705
,a73f9c709
,ae304b33c
,ef42d717c
,d5312e6b9
,22ec50e36
,0f4709356
,c22dcde7b
,bd37be707
,f8954fb17
,96b0bd14e
,f93c79b94
,fbf1da26a
,53e164cbc
,c564825f3
,261eb520b
,395b4a2dd
]:
- #257
89d16c972
Thanks @benjie! - PgClassSinglePlan is now enforced, users will be informed if plans return a step incompatible with the given GraphQL object type. - Updated dependencies
[
89d16c972
,8f323bdc8
,9e7183c02
,fce77f40e
]:
-
#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.
-
#229
13cfc7501
Thanks @benjie! - pgConfig.listen is no more; it was redundant versus PgSubscriber. Have migrated PgIntrospectionPlugin to use PgSubscriber instead. -
#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.
- Updated dependencies [
aac8732f9
]:
- Updated dependencies
[
397e8bb40
]:
-
#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 [
b58f5dfac
]:
- Updated dependencies [
f48860d4f
]:
a8d26b30a
-ignoreReplaceIfNotExists
now truly ignores replacement inflectors. Better handle disabled NodePlugin.
5812ad277
- Deal better with NodePlugin being disabled.
-
#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.
- #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
,afa0ea5f6
,92c2378f2
,851b78ef2
,384b3594f
]:
- Updated dependencies
[
a14bd2288
,dca706ad9
]:- @dataplan/[email protected]
- [email protected]
- Updated dependencies [
e5b664b6f
]:
-
0ab95d0b1
- Update sponsors. -
#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
,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
]:
- 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 -
Updated dependencies [
3eb9da95e
]:
-
#178
1b040b3ba
Thanks @benjie! -@omit
and similar smart tags are now processed on@foreignKey
and other fake constraints. -
#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. -
#176
11d6be65e
Thanks @benjie! - Fix issue with plugin versioning. Add more TSDoc comments. New getTerminalWidth() helper.
- 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. -
Updated dependencies [
6ebe3a13e
,0e440a862
]:- [email protected]
- @dataplan/[email protected]
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 [
4ca7fce12
,677c8f5fc
]:
- Updated dependencies [
c4213e91d
]:- @dataplan/[email protected]
-
9b296ba54
- More secure, more compatible, and lots of fixes across the monorepo -
Updated dependencies [
9b296ba54
]:
- Updated dependencies [
768f32681
]:
- Updated dependencies [
9ebe3d860
]:- @dataplan/[email protected]
- Updated dependencies [
bf83f591d
]:- @dataplan/[email protected]
- Updated dependencies [
25037fc15
]:
- Updated dependencies [
55f15cf35
]:
-
Updated dependencies [
91f2256b3
]: