v8.0.0
8.0.0-rc.5
Patch Changes
- #2990
5d408bd
Thanks @benjie! - No code changes. Updates the
release process, cleans up package.json, uses fixed identifiers for peer
dependencies (unless they're explicit dependencies also). Hopefully move to
trusted publishing.
8.0.0-rc.4
Patch Changes
-
#2957
5615d3f
Thanks @benjie! - Significantly reduce the size
of a PostGraphile exported schema (around 20% reduction on test fixtures) by:- marking optional things as optional
- excluding many optional things from being specified in configuration objects
(includingtagsobjects if no tags are present) - using
LIST_TYPESfor PostgreSQL builtin list types - extracting inline function definitions to be global functions where
appropriate, and simplifying functions where not
Breaking changes to types (but more accurate reflection of reality):
extensionsis now marked as optional in many places.extensions.tagsis now marked optional in many places.PgCodecAttribute.notNullis now marked as optional.PgResourceParameter.requiresis now marked as optional.PgCodecRelation.isUniqueis now marked as optional.pgGetArgDetailsFromParameters().argDetails.postgresArgNameis now optional
(may returnundefinedin addition tonull) and.requiredis now
optional (returnsboolean | undefined)
8.0.0-rc.3
Patch Changes
8.0.0-rc.2
Patch Changes
8.0.0-rc.1
Patch Changes
8.0.0-beta.8
Patch Changes
-
#2682
88146e2
Thanks @benjie! - 🚨 Fix bug where names were
incorrectly derived for AmberPreset/RelayPreset.If you need to restore the old (broken) behavior, use something this plugin
(untested):const ShinyFlowersBeamUndoPlugin = { name: "ShinyFlowersBeamUndoPlugin", inflection: { replace: { _getBaseNameFromKeys(original, preset, detailedKeys) { if (detailedKeys.length === 1) { const key = detailedKeys[0]; const attributeName = this._attributeName({ ...key, skipRowId: false, // HACK: deliberately opt in to poor naming }); return this._getBaseName(attributeName); } if (preset.schema?.pgSimplifyMultikeyRelations) { const attributeNames = detailedKeys.map((key) => this._attributeName({ ...key, skipRowId: true, // HACK: deliberately opt in to poor naming }), ); const baseNames = attributeNames.map((attributeName) => this._getBaseName(attributeName), ); // Check none are null if (baseNames.every((n) => n)) { return baseNames.join("-"); } } return null; }, }, }, };
8.0.0-beta.7
Patch Changes
- #2482
459e1869a2ec58925b2bac5458af487c52a8ca37
Thanks @benjie! - Minimum version of Node.js
bumped to Node 22 (the latest LTS).
8.0.0-beta.6
Patch Changes
8.0.0-beta.5
Patch Changes
8.0.0-beta.4
Patch Changes
8.0.0-beta.3
Patch Changes
8.0.0-beta.2
Patch Changes
8.0.0-beta.1
Patch Changes
8.0.0-alpha.4
Patch Changes
- #408
01ad64d5d
Thanks @benjie! - RenamedgetBaseName,
baseNameMatches,getOppositeBaseNameandgetBaseNameFromKeysinflectors
to all begin with an underscore (_) - this is because these inflectors
should only be used from other inflectors, since they may return non-string
types (null/boolean/etc).
8.0.0-alpha.3
Patch Changes
8.0.0-alpha.2
Patch Changes
-
f61879689
Thanks @benjie! - Fix baseNameMatches to resolve
a regression in simplify-inflector V7 compatibility. -
7f857950a
Thanks @benjie! - Upgrade to the latest
TypeScript/tslib
8.0.0-alpha.1
Patch Changes
759ad403d
Thanks @benjie! - Alpha release - see
https://postgraphile.org/news/2023-04-26-version-5-alpha
8.0.0-1.1
Patch Changes
-
#260
d5312e6b9
Thanks @benjie! - TypeScript v5 is now required -
#260
96b0bd14e
Thanks @benjie! -PgSourcehas been renamed to
PgResource,PgTypeCodectoPgCodec,PgEnumTypeCodectoPgEnumCodec,
PgTypeColumntoPgCodecAttribute(and similar for related
types/interfaces).sourcehas been replaced byresourcein various of the
APIs where it relates to aPgResource.PgSourceBuilderis no more, instead being replaced withPgResourceOptions
and being built into the finalPgResourcevia the new
makeRegistryBuilder/makeRegistryfunctions.build.inputno longer contains thepgSourcesdirectly, instead
build.input.pgRegistry.pgResourcesshould be used.The new registry system also means that various of the hooks in the gather
phase have been renamed/replaced, there's a newPgRegistryPluginplugin in
the default preset. The only plugin that uses themainmethod in the
gatherphase 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 uselexicographicSortSchemaon 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,PgUpdateStepandPgDeleteStepnow all accept the resource
as their single type parameter rather than accepting the 4 generics they did
previously.PgClassExpressionStepnow accepts just a codec and a resource as
generics.PgResourceandPgCodechave 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
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 relatedpgConfigterms such
asmakePgConfig->makePgService,MakePgConfigOptions->
MakePgServiceOptions, etc) - see yourgraphile.config.tsor equivalent
file- All
*:source:*behaviors are now*:resource:*behaviors (use regexp
/:source\b|\bsource:[a-z$]/to find the places that need updating) PgDatabaseConfiguration->PgServiceConfigurationdatabaseName->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.fromPgSelectPlanJoin::source->PgSelectPlanJoin.fromhelpers.pgIntrospection.getDatabase->
helpers.pgIntrospection.getServicehelpers.pgIntrospection.getExecutorForDatabase->
helpers.pgIntrospection.getExecutorForService
8.0.0-0.5
Patch Changes
a8d26b30a-ignoreReplaceIfNotExistsnow truly ignores
replacement inflectors. Better handle disabled NodePlugin.
8.0.0-0.4
Patch Changes
- #211
f9c523bb6
Thanks @benjie! - Simplified relations should
still respect foreignFieldName if present
8.0.0-0.3
Patch Changes
0ab95d0b1- Update sponsors.
8.0.0-0.2
Patch Changes
-
#177
6be68a53e
Thanks @benjie! -@foreignFieldNamesmart tag
is now fed into theinflection.connectionField(...)or
inflection.listField(...)inflector as appropriate. If you are using
@foreignSimpleFieldNameyou may be able to delete that now; alternatively
you should consider renaming@foreignFieldNameto
@foreignConnectionFieldNamefor consistency. -
#176
11d6be65e
Thanks @benjie! - Fix issue with plugin
versioning. Add more TSDoc comments. New getTerminalWidth() helper.
8.0.0-0.1
Patch Changes
867121cfb- V5 port of @graphile-contrib/pg-simplify-inflector
This is based on V7 of @graphile-contrib/pg-simplify-inflector, rewritten for
PostGraphile V5. The previous versions relate to
@graphile-contrib/pg-simplify-inflector instead.
v7.0.0
Simplify primary key to primary key references
If you have two tables that share a primary key value, this version will
simplify the reference. For example with the following database schema:
create table animals (
id serial primary key,
name text
);
create table dogs (
animal_id int primary key references animals,
wags_tail bool
);This will create Animal.dog (rather than Animal.dogById) and Dog.animal
(rather than Dog.animalById).
v6.1.0
Add @listSuffix smart tag
Previously there was no easy way to override pgOmitListSuffix on a per-entity
basis. With the @listSuffix tag you can selectively control naming of both
collection types:
create table companies (id serial primary key);
comment on table companies is E'@listSuffix omit';By default (pgOmitListSuffix = null and simpleCollections = 'both') this
produces:
- allCompanies(
+ companiesConnection(- allCompaniesList(
+ companies(v6.0.0
Pluralization fixes
Previously we fed the entire table/etc name into pluralize but this causes
issues for special cases, for example while pluralize('genus') correctly gives
genera, pluralize('old_genus') would give old_genus which is not correct.
Now we segment on underscores/capitals and only pluralize the final segment, so
we're more likely to get the correct result.
This affects everywhere in your entire GraphQL schema where
pluralize/singularize is used.
Simplify multi-key relationships.
foreign key (organization_id, team_id, goal_uuid) references goalsNow named better:
- goalByOrganizationIdAndTeamIdAndGoalUuid: Goal
+ organizationTeamGoal: GoalUnique relations get shorter-named reverse field.
This was a bug (or, really, an omission) in v5.
For this table:
create table mascots (
id serial primary key,
company_id int unique not null references companies,
name text not null
);Previously we had the plural relationship simplified:
- mascotsByCompanyId(
+ mascots(But the singular was not. This update changes the singular too:
- mascotByCompanyId: Mascot
+ mascot: Mascotv5.0.0-beta.1
v5.0.0-beta.0
More advanced guesses at field names for reverse relations. Ability to omit list
suffix, simplify patch names, turn on/off simplifying of the 'all' from
'allUsers', ability to change the 'ById' primary key fields to not have that
suffix and instead have the node ID fetchers have a suffix.
v3.0.0
Simplifies naming in more of the schema.
v2.0.0
Breaking change: single relation names based on a single key are now named after
the key rather than the target table so long as the key is of the form foo_id,
foo_uuid.
create table posts (
id serial primary key,
author_id int not null references users,
body text not null
); type Post {
nodeId: ID!
id: Int!
authorId: Int!
- user: User
+ author: User
body: String!
}v1.0.0
Initial release