Commit 3b7ac62
committed
feat: projection with
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 },
},
});
```* key request all fields from database1 parent 2125f90 commit 3b7ac62
File tree
5 files changed
+328
-223
lines changed- flow-typed/npm
- src
- __tests__
- __snapshots__
- resolvers/helpers
- __tests__
5 files changed
+328
-223
lines changed
0 commit comments