Releases: graphql-compose/graphql-compose-mongoose
Releases · graphql-compose/graphql-compose-mongoose
v9.1.0
v9.0.1
v9.0.0
9.0.0 (2020-09-30)
You can find detailed Release Notes on this page.
Code Refactoring
- refactor
pagination
&connection
resolvers. Now they are usingcount
&findMany
resolver instances instead of getting them bystring
-name. Move them frompeerDependencies
todependencies
. (f67a39f) - updateById: pull out
_id
arg fromrecord
. It was an old schema design error. (84574b7) - get rid of
getRecordIdFn()
; add test helper functionstestOperation()
&testFieldConfig()
(7e3de3d), closes #262
Features
- add
{sort: { multi: true }}
option to resolvers which have sort arg. This option makessort
arg as List where the client can provide several sorting keys. (0f5e435), closes #210 - add
defaultsAsNonNull
options tocomposeMongoose
method which makes all fields with default values as NonNull in GraphQL Schema (1cedd33), closes #261 - add
payload.error
field to all mutation resolvers. If client requesterror
field then typed error will be returned in mutation payload, otherwise it will be on top-levelerrors
field. (bafc03f) - add
RegExpAsString
GraphQL custom scalar type for filtration by RegExp (2a399aa) - add
suffix
option to resolvers which may generate different sub-types according to config. It allows to avoid Type name collision if you generate several resolvers from one with different configs. (730c062), closes #268 - add new resolvers
dataLoader
,dataLoaderMany
. These resolvers are quite helpful for relations construction between Entities for avoiding the N+1 Problem. (05a3355) - add support for custom _id in models. Before it was only MongoID. Now it can be of any type (Int, String, Object). (d4f6cee), closes #141
- added new function
composeMongoose
which generates TypeComposer without resolvers. Now Resolvers can be generated on-demand in such wayPostTC.mongooseResolvers.findMany()
(before wasPostTC.getResolver('findMany')
). (f36e276), closes #263 - customization option
resolvers.*.filter.operators
now accepttrue
value, it enables operators for all fields in resolver filter (by default operators added only for indexed fields). Also change generated typenames for Operators' types. (5004b1d) - expose
resolverFactory
for manual resolver creation, eg. for cloned types:resolverFactory.findMany(UserModel, ClonedUserTC, opts)
– it generates Resolver's types according toClonedUserTC
type and will use mongooseUserModel
for making requests to DB (b62ef6f) - improve return types for
findByIds
&findMany
now they returns empty array instead of null (ad6ed68) - improve typescript definitions (0ac071d)
- nested aliases are now supported for
filter
,projection
&lean
(d27f79a) - resolvers: now resolvers have typechecks for
args
param (it checks names and presence of required arguments) (1a54aaf)
BREAKING CHANGES
- remove default export from package. Use
import { composeMongoose } from 'graphql-compose-mongoose';
- if you use
ObjectTypeComposer.setRecordIdFn()
for customizationrecordId
in mutations payload then you will need use resolvers config options, eg.createOne(model, tc, { recordIdFn: (doc, context) => source.uid })
. - updateById: resolver
updateById
changes its arguments. Before wasupdateById(record: { _id: 1, name: 'New' })
, now becameupdateById(_id: 1, record: { name: 'New' })
- some internal
filter
type names for args were changed. It may break some clients if you use that type names in your graphql queries:
count
resolver change name for filter typeFilter*Input
->FilterCount*Input
v9.0.0-alpha.11
9.0.0-alpha.11 (2020-09-23)
Bug Fixes
- discriminator: Copy relations to child type composers (51bdecf)
v8.0.4
v9.0.0-alpha.10
9.0.0-alpha.10 (2020-09-15)
Bug Fixes
- revert "Null fields in mongo return sub fields". It brokes
aliases
and old behavior was quite expensive with.toObject
call. (ae34da9)
Code Refactoring
- move out important methods from
composeWithMongose
tocomposeMongose
module (bc9fb7d)
Features
- expose
resolverFactory
for manual resolver creation, eg. for cloned types:resolverFactory.findMany(UserModel, ClonedUserTC, opts)
– it generates Resolver's types according toClonedUserTC
type and will use mongooseUserModel
for making requests to DB (b62ef6f) - nested aliases are now supported for
filter
,projection
&lean
(d27f79a)
BREAKING CHANGES
- remove default export from package. Use
import { composeMongoose } from 'graphql-compose-mongoose';
v9.0.0-alpha.9
9.0.0-alpha.9 (2020-09-14)
Bug Fixes
- refactor
pagination
&connection
resolvers. Now they are usingcount
&findMany
resolver instances instead of getting them bystring
-name. Move them frompeerDependencies
todependencies
. (f67a39f)
v9.0.0-alpha.8
9.0.0-alpha.8 (2020-09-13)
Bug Fixes
v9.0.0-alpha.7
9.0.0-alpha.7 (2020-09-13)
Features
- add
suffix
option to resolvers which may generate different sub-types according to config. It allows to avoid Type name collision if you generate several resolvers from one with different configs. (730c062), closes #268 - add non-nullability for mongoose fields that have a default value (93f265d), closes #261
v9.0.0-alpha.6
9.0.0-alpha.6 (2020-09-12)
Features
- resolvers: now resolvers have typechecks for
args
param (it checks names and presence of required arguments) (1a54aaf) - add support for custom _id in models. Before it was only MongoID. Now it can be of any type (Int, String, Object). (d4f6cee), closes #141
- added new function
composeMongoose
which generates TypeComposer without resolvers. Now Resolvers can be generated on-demand in such wayPostTC.generateResolver.findMany()
(before wasPostTC.getResolver('findMany')
). (f36e276), closes #263