Comparing version 1.0.1 to 1.0.2
@@ -413,3 +413,10 @@ 'use strict'; | ||
const typeFields = schema.types[typeName].fields; | ||
let typeFields = schema.types[typeName].fields; | ||
// if the type is a connection | ||
// then also consider the fields of the connection type in $default | ||
const matches = /(.+)Connection$/.match(typeName); | ||
if (matches) { | ||
const connectionTypeName = matches[1]; | ||
typeFields = _lodash2.default.assign({}, typeFields, schema.types[connectionTypeName].fields); | ||
} | ||
@@ -416,0 +423,0 @@ _lodash2.default.forEach(args.$default, argName => { |
{ | ||
"name": "gqutils", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Utilities For GraphQL", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -431,3 +431,10 @@ import _ from 'lodash'; | ||
const typeFields = schema.types[typeName].fields; | ||
let typeFields = schema.types[typeName].fields; | ||
// if the type is a connection | ||
// then also consider the fields of the connection type in $default | ||
const matches = /(.+)Connection$/.match(typeName); | ||
if (matches) { | ||
const connectionTypeName = matches[1]; | ||
typeFields = _.assign({}, typeFields, schema.types[connectionTypeName].fields); | ||
} | ||
@@ -434,0 +441,0 @@ _.forEach(args.$default, (argName) => { |
167821
2012