@graphql-mesh/transform-prefix 0.103.7 → 0.103.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/barePrefix.js +3 -1
- package/esm/barePrefix.js +3 -1
- package/package.json +1 -1
package/cjs/barePrefix.js
CHANGED
|
@@ -38,7 +38,9 @@ class BarePrefix {
|
|
|
38
38
|
const existingResolver = type.resolveType;
|
|
39
39
|
type.resolveType = async (data, context, info, abstractType) => {
|
|
40
40
|
const typeName = await existingResolver(data, context, info, abstractType);
|
|
41
|
-
|
|
41
|
+
// an extended type might already implement the resolver of a previously
|
|
42
|
+
// transformed type, hence prefix would have already been applied
|
|
43
|
+
return typeName.startsWith(this.prefix) ? typeName : this.prefix + typeName;
|
|
42
44
|
};
|
|
43
45
|
const currentName = type.name;
|
|
44
46
|
return (0, utils_1.renameType)(type, this.prefix + currentName);
|
package/esm/barePrefix.js
CHANGED
|
@@ -36,7 +36,9 @@ export default class BarePrefix {
|
|
|
36
36
|
const existingResolver = type.resolveType;
|
|
37
37
|
type.resolveType = async (data, context, info, abstractType) => {
|
|
38
38
|
const typeName = await existingResolver(data, context, info, abstractType);
|
|
39
|
-
|
|
39
|
+
// an extended type might already implement the resolver of a previously
|
|
40
|
+
// transformed type, hence prefix would have already been applied
|
|
41
|
+
return typeName.startsWith(this.prefix) ? typeName : this.prefix + typeName;
|
|
40
42
|
};
|
|
41
43
|
const currentName = type.name;
|
|
42
44
|
return renameType(type, this.prefix + currentName);
|