File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed
Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -324,9 +324,22 @@ module.exports = function PgConnectionArgFilterPlugin(
324324 filterTypeName ,
325325 source ,
326326 sourceTypeName
327- ) =>
328- connectionFilterTypesByTypeName [ filterTypeName ] ||
329- newWithHooks (
327+ ) => {
328+ const existingType = connectionFilterTypesByTypeName [ filterTypeName ] ;
329+ if ( existingType ) {
330+ if (
331+ typeof existingType . _fields === "object" &&
332+ Object . keys ( existingType . _fields ) . length === 0
333+ ) {
334+ // Existing type is fully defined and
335+ // there are no fields, so don't return a type
336+ return null ;
337+ }
338+ // Existing type isn't fully defined or is
339+ // fully defined with fields, so return it
340+ return existingType ;
341+ }
342+ return newWithHooks (
330343 GraphQLInputObjectType ,
331344 {
332345 description : `A filter to be used against \`${ sourceTypeName } \` object types. All fields are combined with a logical ‘and.’` ,
@@ -338,6 +351,7 @@ module.exports = function PgConnectionArgFilterPlugin(
338351 } ,
339352 true
340353 ) ;
354+ } ;
341355
342356 const escapeLikeWildcards = input => {
343357 if ( "string" !== typeof input ) {
You can’t perform that action at this time.
0 commit comments