Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
fix(RenameTypes): new required arg
Browse files Browse the repository at this point in the history
  • Loading branch information
yaacovCR committed Oct 13, 2019
1 parent fb46c75 commit a6e65e1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
"uuid": "^3.3.3"
},
"peerDependencies": {
"graphql": "^14.2.0"
"graphql": "^14.5.8"
},
"devDependencies": {
"@types/chai": "^4.2.3",
"@types/dateformat": "^3.0.1",
"@types/mocha": "^5.2.7",
"@types/node": "^12.7.7",
"@types/node": "^12.7.12",
"@types/uuid": "^3.4.5",
"@types/zen-observable": "^0.8.0",
"body-parser": "^1.19.0",
Expand All @@ -73,13 +73,13 @@
"graphql-subscriptions": "^1.1.0",
"graphql-type-json": "^0.3.0",
"istanbul": "^0.4.5",
"mocha": "^6.2.0",
"mocha": "^6.2.1",
"prettier": "^1.18.2",
"remap-istanbul": "0.13.0",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.13",
"standard-version": "^7.0.0",
"tslint": "^5.20.0",
"typescript": "3.6.3"
"typescript": "3.6.4"
}
}
6 changes: 3 additions & 3 deletions src/transforms/RenameTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ export default class RenameTypes implements Transform {
}, {
[VisitSchemaKind.ABSTRACT_TYPE]: (type: GraphQLAbstractType) => {
const originalResolveType = type.resolveType;
type.resolveType = (value, info, context) => {
type.resolveType = (value, info, context, abstractType) => {
if (isParentProxiedResult(value)) {
const oldName = originalResolveType(value, info, context) as string;
const oldName = originalResolveType(value, info, context, abstractType) as string;
const newName = this.renamer(oldName);
return newName ? newName : oldName;
}
return originalResolveType(value, info, context);
return originalResolveType(value, info, context, abstractType);
};
return type;
},
Expand Down

0 comments on commit a6e65e1

Please sign in to comment.