diff --git a/dist-lib/filters/input-type-generator.js b/dist-lib/filters/input-type-generator.js index ec46b52..c1692a8 100644 --- a/dist-lib/filters/input-type-generator.js +++ b/dist-lib/filters/input-type-generator.js @@ -39,8 +39,10 @@ var InputMapPrefixes; const filterFullTypes = new Map(); const filterTypes = new Map(); const propertyTypes = new Map(); -const generateFilterPropertyType = (field, parentName) => { - const key = `${(0, functions_1.standardize)(field.name)}_${parentName}_${InputMapPrefixes.PropertyFilterInputType}`; +const generateFilterPropertyType = (field) => { + var _a; + const typeName = field.typeFn && ((_a = field.typeFn()) === null || _a === void 0 ? void 0 : _a.name); + const key = `${(0, functions_1.standardize)(typeName)}_${InputMapPrefixes.PropertyFilterInputType}`; const propType = propertyTypes.get(key); if (propType) return propType; @@ -115,7 +117,7 @@ function generateFilterInputType(classes, name) { if (typeof field.typeFn === 'function') { field.typeFn(); } - const fieldType = generateFilterPropertyType(field, name); + const fieldType = generateFilterPropertyType(field); (0, graphql_1.Field)(() => fieldType, { nullable: true })(PartialObjectType.prototype, field.name); } else { diff --git a/dist-lib/filters/input-type-generator.js.map b/dist-lib/filters/input-type-generator.js.map index ea246d2..2d0e911 100644 --- a/dist-lib/filters/input-type-generator.js.map +++ b/dist-lib/filters/input-type-generator.js.map @@ -1 +1 @@ -{"version":3,"file":"input-type-generator.js","sourceRoot":"","sources":["../../lib/filters/input-type-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqG;AAErG,kDAAiD;AACjD,2CAAuI;AAGvI,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB,2BAAS,CAAA;IACT,6BAAW,CAAA;IACX,2BAAS,CAAA;IACT,6BAAW,CAAA;IACX,2BAAS,CAAA;IACT,6BAAW,CAAA;IACX,2BAAS,CAAA;IACT,iCAAe,CAAA;IACf,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;IACnB,2CAAyB,CAAA;IACzB,+BAAa,CAAA;AACf,CAAC,EAdW,cAAc,GAAd,s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AC;AAyBM,MAAM,sBAAsB,GAAG,CAAC,OAAqB,EAAE,IAAY,EAAE,EAAE;IAC5E,MAAM,GAAG,GAAG,GAAG,IAAI,kBAAkB,CAAC;IACtC,IAAI,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC5B,OAAO,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACjC;IACD,MAAM,eAAe,GAAG,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAE/D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,eAAe;KAO7C,CAAA;IANC;QAAC,IAAA,eAAK,EAAC,EAAC,YAAY,EAAE,8CAAkC,EAAE,WAAW,EAAE,qEAAqE,EAAC,CAAC;;oDAC/H;IACf;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;iDAC/B;IAClB;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;gDAChC;IANb,gBAAgB;QADrB,IAAA,mBAAS,EAAC,GAAG,CAAC;OACT,gBAAgB,CAOrB;IACD,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC3C,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAA;AAjBY,QAAA,sBAAsB,0BAiBlC"} \ No newline at end of file +{"version":3,"file":"input-type-generator.js","sourceRoot":"","sources":["../../lib/filters/input-type-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqG;AAErG,kDAAiD;AACjD,2CAAuI;AAGvI,IAAY,cAcX;AAdD,WAAY,cAAc;IACxB,2BAAS,CAAA;IACT,6BAAW,CAAA;IACX,2BAAS,CAAA;IACT,6BAAW,CAAA;IACX,2BAAS,CAAA;IACT,6BAAW,CAAA;IACX,2BAAS,CAAA;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AA,eAAK,EAAC,GAAG,EAAE,CAAC,SAAS,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;SAClF;aAAM;SAON;KACF;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AAyBM,MAAM,sBAAsB,GAAG,CAAC,OAAqB,EAAE,IAAY,EAAE,EAAE;IAC5E,MAAM,GAAG,GAAG,GAAG,IAAI,kBAAkB,CAAC;IACtC,IAAI,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QAC5B,OAAO,eAAe,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KACjC;IACD,MAAM,eAAe,GAAG,uBAAuB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAE/D,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,eAAe;KAO7C,CAAA;IANC;QAAC,IAAA,eAAK,EAAC,EAAC,YAAY,EAAE,8CAAkC,EAAE,WAAW,EAAE,qEAAqE,EAAC,CAAC;;oDAC/H;IACf;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;iDAC/B;IAClB;QAAC,IAAA,eAAK,EAAC,GAAG,EAAE,CAAC,CAAC,eAAe,CAAC,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;gDAChC;IANb,gBAAgB;QADrB,IAAA,mBAAS,EAAC,GAAG,CAAC;OACT,gBAAgB,CAOrB;IACD,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;IAC3C,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAA;AAjBY,QAAA,sBAAsB,0BAiBlC"} \ No newline at end of file diff --git a/lib/filters/input-type-generator.ts b/lib/filters/input-type-generator.ts index edc034b..c892b88 100644 --- a/lib/filters/input-type-generator.ts +++ b/lib/filters/input-type-generator.ts @@ -47,8 +47,9 @@ const filterFullTypes = new Map(); const filterTypes = new Map(); const propertyTypes = new Map() -const generateFilterPropertyType = (field, parentName: string) => { - const key = `${standardize(field.name)}_${parentName}_${InputMapPrefixes.PropertyFilterInputType}`; +const generateFilterPropertyType = (field) => { + const typeName = field.typeFn && field.typeFn()?.name; + const key = `${standardize(typeName)}_${InputMapPrefixes.PropertyFilterInputType}`; const propType = propertyTypes.get(key); if (propType) return propType; @@ -138,7 +139,7 @@ function generateFilterInputType(classes: T[], name: strin if (typeof field.typeFn === 'function') { field.typeFn(); } - const fieldType = generateFilterPropertyType(field, name); + const fieldType = generateFilterPropertyType(field); Field(() => fieldType, {nullable: true})(PartialObjectType.prototype, field.name) } else { // Relations are not supported yet