Skip to content

v1.10.0

Compare
Choose a tag to compare
@nodkz nodkz released this 22 Nov 09:23
· 351 commits to master since this release

1.10.0 (2017-11-22)

Features

  • projection with * key request all fields from database (3b7ac62)

By default graphql-compose-mongoose requests that fields which are listed in the graphql query. So you may want to add some rawData field to your type for debug/administrative purposes with all fields in such way:

UserTC.addFields({
  rawData: {
    type: 'JSON',
    resolve: (source, args, context) => (context.isAdmin() ? source.toJSON() : null),
    projection: { '*': true }, // <-- request all fields from MongoDB, if requested `rawData`
  },
});