Skip to content

Commit

Permalink
feat: projection with * key request all fields from database
Browse files Browse the repository at this point in the history
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 in such way:
```js
UserTC.addFields({
  rawData: {
    type: 'JSON',
    resolve: (source, args, context) => (context.isAdmin() ?
source.toJSON() : null),
    projection: { '*': true },
  },
});
```
  • Loading branch information
nodkz committed Nov 22, 2017
1 parent 2125f90 commit 3b7ac62
Show file tree
Hide file tree
Showing 5 changed files with 328 additions and 223 deletions.
Loading

0 comments on commit 3b7ac62

Please sign in to comment.