We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to transform some TS that looks like this:
@Query((_returns) => AwardedBid) async awardedBidForAgent(@Ctx() context: ResolverContext, @Arg('id', (_type) => ID) id: string) { const { user } = context; const bid = await this.prisma.bid.findFirst({ /// ... rejectOnNotFound: true, }); return { /// .... }; }
Using this custom plugin:
function propIsRejectOnNotFound(prop) { return prop.key.name === 'rejectOnNotFound'; } export default function (babel) { const { types: t } = babel; return { name: 'ast-transform', // not required visitor: { Identifier(path) {}, CallExpression(path) { if (['findUnique', 'findFirst'].includes(path.node.callee.property.name)) { if (path.node.arguments[0].type === 'ObjectExpression') { console.log(path.node.arguments); const arg = path.node.arguments[0].properties.findIndex(propIsRejectOnNotFound); console.log({ arg }); if (arg) { path.node.arguments[0].properties.splice(arg, 1); path.node.callee.property.name += 'OrThrow'; } } } }, }, }; }
I get this error when using the CLI:
Decorators cannot be used to decorate parameters.
The text was updated successfully, but these errors were encountered:
--parser-plugins
Try @codemod/[email protected] (just published) like so:
codemod --parser-plugins decorators-legacy …
Sorry, something went wrong.
No branches or pull requests
Trying to transform some TS that looks like this:
Using this custom plugin:
I get this error when using the CLI:
The text was updated successfully, but these errors were encountered: