ALL MAJOR RELEASES ARE BREAKING.
When the names in your GraphQL schema change you have to rewrite all your queries. You're not really meant to update major versions. Pick a major and stick to it.
It's unlikely we'll have much in the way of minor releases since all naming changes are breaking.
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
).
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(
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.
foreign key (organization_id, team_id, goal_uuid) references goals
Now named better:
- goalByOrganizationIdAndTeamIdAndGoalUuid: Goal
+ organizationTeamGoal: Goal
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: Mascot
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.
Simplifies naming in more of the schema.
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!
}
Initial release