Skip to content

Commit

Permalink
fix: model discriminator type is undefined(nicky-lenaers#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
hennessyevan committed Oct 23, 2019
1 parent 23acd1e commit 3eb4dd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nicky-lenaers/mogr",
"version": "1.6.0",
"version": "1.6.1",
"description": "MoGr dynamically maps GraphQL AST's to Mongoose Query Projection and/or Population and provides GraphQL Cursor Pagination.",
"main": "lib/index.js",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ export class Registry {
fields: PopulatableField[] = []
): PopulatableField[] {

if (!type) {
return []
}

if (type.ref && typeof type.ref === 'string') {

if (!fields.map(field => field.path).includes(path)) {
Expand Down

0 comments on commit 3eb4dd2

Please sign in to comment.