Skip to content

Releases: graphql-compose/graphql-compose-mongoose

v9.1.0

11 Feb 19:54
Compare
Choose a tag to compare

9.1.0 (2021-02-11)

Features

  • update dependencies (bb5a797)
  • TypeScript: migrate mongoose typings from @types/mongoose to built-in types in v5.11 (01c015d)

v9.0.1

02 Feb 21:02
Compare
Choose a tag to compare

9.0.1 (2021-02-02)

Bug Fixes

  • filter _operator now works for nested fields (313ea1f), closes #304

v9.0.0

30 Sep 21:42
0030927
Compare
Choose a tag to compare

9.0.0 (2020-09-30)

You can find detailed Release Notes on this page.

Code Refactoring

  • refactor pagination & connection resolvers. Now they are using count & findMany resolver instances instead of getting them by string-name. Move them from peerDependencies to dependencies. (f67a39f)
  • updateById: pull out _id arg from record. It was an old schema design error. (84574b7)
  • get rid of getRecordIdFn(); add test helper functions testOperation() & testFieldConfig() (7e3de3d), closes #262

Features

  • add {sort: { multi: true }} option to resolvers which have sort arg. This option makes sort arg as List where the client can provide several sorting keys. (0f5e435), closes #210
  • add defaultsAsNonNull options to composeMongoose 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 request error field then typed error will be returned in mutation payload, otherwise it will be on top-level errors 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 way PostTC.mongooseResolvers.findMany() (before was PostTC.getResolver('findMany')). (f36e276), closes #263
  • customization option resolvers.*.filter.operators now accept true 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 to ClonedUserTC type and will use mongoose UserModel 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 customization recordId 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 was updateById(record: { _id: 1, name: 'New' }), now became updateById(_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 type Filter*Input -> FilterCount*Input

v9.0.0-alpha.11

23 Sep 18:00
Compare
Choose a tag to compare
v9.0.0-alpha.11 Pre-release
Pre-release

9.0.0-alpha.11 (2020-09-23)

Bug Fixes

  • discriminator: Copy relations to child type composers (51bdecf)

v8.0.4

23 Sep 17:50
Compare
Choose a tag to compare

8.0.4 (2020-09-23)

Bug Fixes

  • discriminator: Copy relations to child type composers (51bdecf)

v9.0.0-alpha.10

15 Sep 20:35
Compare
Choose a tag to compare
v9.0.0-alpha.10 Pre-release
Pre-release

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 to composeMongose module (bc9fb7d)

Features

  • expose resolverFactory for manual resolver creation, eg. for cloned types: resolverFactory.findMany(UserModel, ClonedUserTC, opts) – it generates Resolver's types according to ClonedUserTC type and will use mongoose UserModel 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

14 Sep 13:56
Compare
Choose a tag to compare
v9.0.0-alpha.9 Pre-release
Pre-release

9.0.0-alpha.9 (2020-09-14)

Bug Fixes

  • refactor pagination & connection resolvers. Now they are using count & findMany resolver instances instead of getting them by string-name. Move them from peerDependencies to dependencies. (f67a39f)

v9.0.0-alpha.8

13 Sep 21:29
Compare
Choose a tag to compare
v9.0.0-alpha.8 Pre-release
Pre-release

9.0.0-alpha.8 (2020-09-13)

Bug Fixes

  • aliases: Consider aliases from discriminators during preparation (#253) (aaa59a7)

v9.0.0-alpha.7

13 Sep 21:19
Compare
Choose a tag to compare
v9.0.0-alpha.7 Pre-release
Pre-release

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

12 Sep 12:14
Compare
Choose a tag to compare
v9.0.0-alpha.6 Pre-release
Pre-release

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 way PostTC.generateResolver.findMany() (before was PostTC.getResolver('findMany')). (f36e276), closes #263