Releases: join-monster/join-monster
v4.0.0
What's Changed
Breaking changes:
It is no longer guaranteed that a field's value is available under source[fieldName]
in a custom resolver. Instead, custom resolvers on non-trivial fields need to use GraphQL's default resolver to get the field value:
import { defaultFieldResolver } from 'graphql'
const User = new GraphQLObjectType({
//...
fields: () => ({
//...
following: {
// ...
resolve: (source, args, context, info) => {
const value = defaultFieldResolver(source, args, context, info)
return processUsers(value)
}
}
})
})
See the docs on custom resolvers for more details.
New Contributors
Full Changelog: v3.3.5...v4.0.0
v3.3.5
What's Changed
Most relevant to users
- Add
aliasPrefix
option by @jasonwoodland in #533 - Handle disjoint fields requested across union types (another approach) by @nicoabie in #519
- Warns when alias length is exceeded for what postgres allows by @nicoabie in #526
- Make demo runnable again by @nicoabie in #523
Other stuff relevant to the project itself
- [CI]: fix docker images versions by @nicoabie in #520
- [CI]: second attempt to fixing docker flakiness when starting services by @nicoabie in #521
- Fix readthedocs deploys by @nicoabie in #525
- Bump tornado from 5.0 to 6.3.3 in /docs by @dependabot in #528
- add test to make sure different names won't collapse to same alias by @nicoabie in #530
- Updates mkdocs to 1.5.3 by @nicoabie in #534
New Contributors
- @jasonwoodland made their first contribution in #533
Full Changelog: v3.3.4...v3.3.5
v3.3.4
What's Changed
- maybeQuote now handles BigInts properly by @alainnahalliday in #467
- Ensure that empty fallback has page info by @garymardell in #478
- Bump trim-off-newlines from 1.0.1 to 1.0.3 by @dependabot in #468
- Bump ajv from 6.12.2 to 6.12.6 by @dependabot in #469
- Bump minimist from 1.2.5 to 1.2.6 by @dependabot in #474
- Bump urijs from 1.19.7 to 1.19.11 by @dependabot in #479
- update to handle graphql v16_x breaking changes by @bueche in #495
- package changes to support node19 by @bueche in #496
- changes to get rid of some security vulnerabilities by @bueche in #498
- ava upgrade by @bueche in #499
- update change log for new patch and add node v20 support by @bueche in #500
- Feat/changelog update by @bueche in #501
- fix for tag install issue by @bueche in #502
- Fix/patch by @bueche in #503
- eliminate dynamic require so join-monster can be used with react native by @bueche in #506
- update to change log by @bueche in #507
- Feat/update3.3.2 by @bueche in #509
- 3.3.2 by @bueche in #508
- Update CHANGELOG.md by @lorensr in #504
- fix: typing for GraphQLFieldExtensions by @PeterMuenchow in #511
- fix minify jm issues by @bueche in #514
- npm audit fix to upgrade dependencies by @bueche in #516
- release 3.3.4 by @bueche in #517
New Contributors
- @alainnahalliday made their first contribution in #467
- @garymardell made their first contribution in #478
- @bueche made their first contribution in #495
- @lorensr made their first contribution in #504
- @PeterMuenchow made their first contribution in #511
Full Changelog: v3.1.1...v3.3.4
Join Monster V2
New features:
LIMIT
functionality, supported on all fields- Fetch columns from junction tables
- For fields with junctions, you can now specify
WHERE
andORDER BY
clauses on the junction table or the main table, including paginated fields. - Ability to dynamically choose pagination implementation per-request.
- Better ability to write
where
functions that depend on args and info from the parent/ancestors.
Breaking changes:
- Fields with junctions have a new interface in order to support the new features.
- Any
where
,orderBy
, andsortKey
on many-to-many paginated fields used to be applied to the junction table. This has changed, and will be applied to the main table instead in order to be consistent with non-paginated junctions. If the old behavior is desired, you can nest those properties inside thejunction
object, which is part of the new API. - Change 4th parameter of
where
andsqlExpr
to the field's SQL AST Node, which is a lot more useful.
// this...
{
type: new GraphQLList(User),
junctionTable: 'relationships',
sqlJoins: [
(followers, relations) => `${followers}.id = ${relations}.follower_id`,
(relations, followees) => `${relations}.followee_id = ${followees}.id`
]
}
// is now this...
{
type: new GraphQLList(User),
junction: {
sqlTable: 'relationships',
sqlJoins: [
(followers, relations) => `${followers}.id = ${relations}.follower_id`,
(relations, followees) => `${relations}.followee_id = ${followees}.id`
]
}
}
// this...
{
type: new GraphQLList(User),
junctionTable: 'relationships',
junctionTableKey: [ 'follower_id', 'followee_id' ],
junctionBatch: {
thisKey: 'follower_id',
parentKey: 'id',
sqlJoin: (relations, followees) => `${relations}.followee_id = ${followees}.id`
}
}
// is now this...
{
type: new GraphQLList(User),
junction: {
sqlTable: 'relationships',
uniqueKey: [ 'follower_id', 'followee_id' ],
sqlBatch: {
thisKey: 'follower_id',
parentKey: 'id',
sqlJoin: (relations, followees) => `${relations}.followee_id = ${followees}.id`
}
}
}
// this...
{
type: UserConnection,
args: forwardConnectionArgs,
sqlPaginate: true,
orderBy: {
created_at: 'DESC',
followee_id: 'ASC'
},
junctionTable: 'relationships',
sqlJoins: [
(followers, relations) => `${followers}.id = ${relations}.follower_id`,
(relations, followees) => `${relations}.followee_id = ${followees}.id`
]
}
// is now this...
{
type: UserConnection,
args: forwardConnectionArgs,
sqlPaginate: true,
junction: {
sqlTable: 'relationships',
sqlJoins: [
(followers, relations) => `${followers}.id = ${relations}.follower_id`,
(relations, followees) => `${relations}.followee_id = ${followees}.id`
],
// the order now goes inside the `junction` if you want to sort on the junction table
orderBy: {
created_at: 'DESC',
followee_id: 'ASC'
}
}
// or you could apply the order on the user table by putting it out here
//orderBy: {
// created_at: 'DESC',
// id: 'ASC'
//}
// you could also place a `where` at either
}
Add Union and Interface Types
v1.2.0 add union and interface types
Release Version 1.0.0
More advanced query planning has arrived! One of the greatest criticisms of Join Monster has been the heavy use of JOIN
s, which can be an expensive database operation. One of the benefits of DataLoader was the ability to simply batch queries. In this release, Join Monster can do both!
You can plan queries that get all your data in a single request using joins, or you can get them in separate batches with queries that use WHERE IN
to get the right data. You can mix these approaches together to find the optimal query plans for your application.
Breaking changes
getSQL
method removed. No longer makes sense in he new multiple-query paradigm.- Offset pagination adds the
total
to the connection object instead of thepageInfo
.
Deprecated
'standard'
dialect is deprecated because nothing really implements the standard. The new default is'sqlite3'
.joinTable
is deprecated. It was renamed tojunctionTable
to avoid over-use of the word "join".
Stable v0
The v0 major version will be stable after this point.
The pre-release of v1.0.0 is coming soon. The most important new feature will be the option to use DataLoader-style batching instead of joins. Join Monster will have more advanced query planning in order to balance the optimizations on network latency due to roundtrips and duplicated data due to joins. Schemas can mix joins and batches to tune the query plans to the heuristics of their application. There will be a few breaking changes.
Q: Is support for Apollo server planned for the near future?
A: We do not use Apollo, so it is not a priority. However, we do want Join Monster to support it, as it is the most highly requested feature. How long this takes will depend largely on community engagement.